Questions tagged [pysimplegui]

Question about PySimpleGUI. The python package that supports simplified GUI generation using Tkinter.

PySimpleGUI is a python package that supports simplified GUI generation using Tkinter.

You can read more about the package here

1204 questions
2
votes
1 answer

Excel align titles to column data using pandas and pySimpleGui

I am creating simple project for data entry, i have successfully created the GUI and excel sheet that has to be in the directory, i am kinda struggling with creating column title and assign text entered by user input in the excel sheet, also…
2
votes
1 answer

I have a problem about DuplicateWidgetID. When program runs it says there are multiple identical st.checkbox widgets with the same generated key

import streamlit as st import functions list = functions.get_list() def add_todo(): todo = st.session_state["new_todo"] + "\n" list.append(todo) functions.write_list(list) st.title("Simple To-Do app") st.subheader("This is my todo…
Sherif98
  • 21
  • 1
2
votes
3 answers

Can I set a resolution of below 0.1 on PySimpleGUI slider?

I have the following statement on my code to create a slider: [sg.Text('SPI Frequency [MHz]: '),sg.Slider((0.50,2.50),1.250,0.750,size=(80,15),orientation='h',key='FREQ_SLIDER',enable_events=True,tick_interval=0.75)] However, my final resolution is…
2
votes
1 answer

How do I subscript text with the Text object (or another object that displays text on the screen)?

When I try to place variables as text, it says this: TypeError: 'Text' object is not subscriptable Here is the code I used to generate this error: import PySimpleGUI as sg font1 = ("Calibri", 15) text1 = "PlaceholderText1" text2 =…
Dev
  • 21
  • 2
2
votes
2 answers

How would I dynamically update buttons in PYSimpleGUI

I am trying to create a looping text based "choose your own adventure" story game. The code is built into separate functions. Each function has a story element (returned in text format), a selection of player choices used for updating the text on…
Joseph Kemper
  • 25
  • 1
  • 1
  • 7
2
votes
1 answer

PySimpleGUI - CalendarButton

I am using a CalendarButton to get a date - no big deal. I have set it's location in the initial layout - also no probs. I am getting the window's location with window_loc = window.CurrentLocation() What I want to do is change the location of the…
MarkT
  • 21
  • 2
2
votes
1 answer

How can I highlight or select a certain string of text upon a button press, inside a Multiline element in using Python?

I have written a GUI program which takes a black and white image, converts it into 2 character ASCII art and counts the sections of characters in each row. It's really hard to explain so I'll paste the code below so you can see what it does. The…
2
votes
1 answer

Proper design pattern for longer PySimpleGUI scripts

I am working on a script that simplifies my daily work routines. Eventually I added a GUI to it using PySimpleGUI. As I add functionality the event loop continues to grow and I am wondering if this is the right way to go. Imagine the following…
divingTobi
  • 2,044
  • 10
  • 25
2
votes
1 answer

PySimpleGUI - Updating a listbox on a button event

I'm trying to make a Python program with a UI that shows simple widget like a frame, a listbox and a table. I would like to populate the listbox with input from the user. So I create the listbox and "fill it" qith a blank list, then the user type in…
2
votes
2 answers

Checking for Duplicates twice over in a File - Python

config.yml example, DBtables: CurrentMinuteLoad: CSV_File: trend.csv Table_Name: currentminuteload GUI image, This may not be the cleanest route to take. I'm making a GUI that creates a config.yml file for another python script I'm…
BabaZuri
  • 19
  • 4
2
votes
0 answers

PySimpleGUI: making Listbox elements selected by default

I am new to PySimpleGUI and I am trying to drag and drop an Apple Music folder into the LISTBOX (creating a list of file paths). Is it possible to make the whole list of file paths selected by default as soon as the folder is dropped into the…
Ibichka
  • 41
  • 1
2
votes
3 answers

Set multiline text from a file online to a text element in pysimplegui

So I have this program that grabs a text file from the internet, reads it and then set the decoded text to an element. import PySimpleGUI as sg import urllib.request data = urllib.request.urlopen("link to a text file") layout = [[sg.Text('',…
2
votes
1 answer

Run code after the window has been initialized

I have a program that has an sg.Output element, and I want a function to run after the window has opened/initialized. This is a sample of my code: import PySimpleGUI as sg import os layout = [[sg.Output(size=(50, 10))]] window =…
SappyCS
  • 53
  • 5
2
votes
1 answer

PySimpleGUI tables - unable to create list of lists

I'm unable to use PySimpleGUI.Table because of my inability to create list of lists, please see my code: def is_compiled(file): full_path = main_path + 'models_data/'+ file[:-3] return isdir(full_path) #Returns bool True of…
se7en94
  • 55
  • 4
2
votes
2 answers

Rendering HTML in PySimpleGUI?

Does anyone know if it's possible to have PySimpleGUI render HTML? I am not after a full-blown browser, just an HTML viewer that lives in a PySimpleGUI window. I know tkinter has a module called tk_html_widgets, I'm also investigating what webview…
Vinman75
  • 25
  • 1
  • 7