tkinter

Values ​of combobox with space in the text

非 Y 不嫁゛ 提交于 2021-01-29 10:21:29
问题 I have a combobox that feeds from a mysql request. The problem if the result has space seems wrong If i have in mysql: test1 in my combobox i have test1 = OK test 2 in my combobox i have {test 2} = Wrong #FRAME INFO frame_info = LabelFrame (Product, text = 'Info Maker',height=240,width=1000) frame_info.place (x=220, y=10) combo_maker = ttk.Combobox(frame_info,state="readonly") #combo_maker['value'] = combo_input() combo_maker['value'] = combo_input() combo_maker.current(0) combo_maker.place(x

Save changed textbutton state back to dictionary value list index 0

非 Y 不嫁゛ 提交于 2021-01-29 10:11:58
问题 Good Day. I have managed to load a dictionary from a text file with this code: def loadDictFile(data_folder): critDict = json.loads(open(data_folder+'critDict3.txt').read()) print('json_data is', critDict) return critDict And I can create a tkinter UI with checkboxes that are on or off according to the dictionary values using the following code: def makeUI(data_folder, critDict): top = Tk() varList=[] for key, val in critDict.items(): myVar = IntVar()#create intVar for this checkbutton

how to change font size of messages inside messagebox.showinfo(message='Hello') in tkinter python3.7

安稳与你 提交于 2021-01-29 10:11:56
问题 I am trying to make displayed message fonts bigger for certain messages when it get displayed so that its easier for eyes to read than standard size. I checked on past post regarding this issue and couldn't found any answers that helps. I found answer using r.option_add but it seems not to have any effect on windows. If any one has gone through this issue and have suggestion/answer to fix this problem i would be thankful to everyone who put their time and effort on it. Thank you. Code i found

Python runtime cannot be located for app created using tkinter and py2app

本小妞迷上赌 提交于 2021-01-29 10:01:24
问题 I'm trying to learn how to use py2app in order to create a simple Mac app from a tkinter GUI and am encountering a runtime error when attempting to do so. My Mac is running OS Catalina 10.15.4. I'm using PyCharm 2020.1 with Python 3.7. My original python installation was done using Anaconda and after trying two IDEs (Spyder and IDLE), I switched to PyCharm. To keep things simple, the app will merely compute the sum of two user-input numbers: from tkinter import Tk, Label, Button,Entry window

Tkinter Button background - white only on a mac (10.15.4)

风流意气都作罢 提交于 2021-01-29 09:41:02
问题 I don't think this is a coding issue, but I would be grateful for some clues. I have some code which turns Tkinter Buttons green or red as they control relays. This works fine on my RaspberryPi but I cannot get any Button background colour except white on my code writing machine a MacPro. I am running Python 3.7.3 and Pycharm 2019.3.4 on both. Raspberian (latest release can’t remember version number) and OSX 10.15.4 on the Mac. When I run from Pycharm, colour can be set for the Window

Updating Labels in Tkinter with for loop

老子叫甜甜 提交于 2021-01-29 09:29:41
问题 So I'm trying to print items in a list dynamically on 10 tkinter Label s using a for loop. Currently I have the following code: labe11 = StringVar() list2_placer = 0 list1_placer = 1 mover = 227 for items in range(10): item_values = str(list1[list1_placer] + " " +list2[list2_placer]) Label(canvas1, width="100", height="2",textvariable=labe11).place(x=200,y=mover) labe11.set(item_values) list1_placer = list1_placer +1 list2_placer = list2_placer +1 mover = mover +50 Where list1 and list2 are

Python - Multi Listbox to Entry box

喜欢而已 提交于 2021-01-29 09:23:33
问题 I am using code for a multi listbox (http://code.activestate.com/recipes/52266-multilistbox-tkinter-widget/) This is creating columns of data for the user to select from, I would like when the user Listboxselect that the columns from the record get populated into different Entry boxes. I can get this to work in a standard Listbox using .bind .delete .insert within a function but because the data within the dictionary is different sizes it looks ugly:) I would really like to stick with the

Destroy events executes the binded function 5 times

左心房为你撑大大i 提交于 2021-01-29 09:22:53
问题 I have some code in python using the tkinter module. I've been trying to bind a function to the "<Destroy>" , but each time I run the code and I close the window, the binded function executs 5 times. Here is the code: def bind_events(self): ''' binding the events to their functions ''' self.master.bind("<Destroy>", lambda x: print("OK")) This code is a class function. Then the output I obtain this: >>> OK OK OK OK OK Is there any solution for this problem. Thank you for your time, and sorry

ForkingPickler(file, protocol).dump(obj) TypeError: cannot pickle '_tkinter.tkapp' object

百般思念 提交于 2021-01-29 09:20:09
问题 Below is my code my function receives data blocks from the server and puts them in a FIFO buffer after which two functions are called in parallel, recvData() #to keep receiving data blocks from the server and put in the FIFO buffer calculate_threshold() #to remove data blocks from the FIFO buffer and perform some calculation, give a real time display on the GUI, and write the result in the file Code import socket import turtle #import timeit import queue import multiprocessing from tkinter

ForkingPickler(file, protocol).dump(obj) TypeError: cannot pickle '_tkinter.tkapp' object

旧巷老猫 提交于 2021-01-29 09:12:47
问题 Below is my code my function receives data blocks from the server and puts them in a FIFO buffer after which two functions are called in parallel, recvData() #to keep receiving data blocks from the server and put in the FIFO buffer calculate_threshold() #to remove data blocks from the FIFO buffer and perform some calculation, give a real time display on the GUI, and write the result in the file Code import socket import turtle #import timeit import queue import multiprocessing from tkinter