tkinter-entry

tkinter: can't enter into entry widget

女生的网名这么多〃 提交于 2019-12-11 01:38:10
问题 I don't understand why the entry boxes under rackGUI.py in my code are static/won't allow anything to be entered. I believe all the Entry objects are instantiated correctly. I specified the textvariable as instances of the StringVar() . My gut tells me the problem lies in command argument in create_button instantiation but I'm not really sure why. I thought by setting command = lambda:function the function would not be called. Upon clicking 'New' in the menu, main.py successfully calls

Python Tkinter entry widget won´t accept input

不羁岁月 提交于 2019-12-11 00:32:06
问题 I have run into a very weird Problem with Tkinter entry widgets. When I try to enter something into them they don´t accept my input. After some PC restarting and Python reinstalling I figured out why this happens: I had a messagebox just before the root.mainloop() in the code. The code looks something like this: def xyz(): if not messagebox.askyesno("Title","Some text"): exit() xyz() root.mainloop() I found, to resolve the issue you can just manually focus on a different window and then back

Tkinter entry widget float

杀马特。学长 韩版系。学妹 提交于 2019-12-10 15:39:41
问题 I have been writing a tkinter application that takes floats from multiple entry widgets and then uses the floats in a calculation to produce a float that can then be displayed in an appropriate label. When I run the application I get 'ValueError: could not convert string to float:' and I can't use the floats in any calculations. This is a small chunk of the code: def click_p1(): p1 = entry_p1.get() try: p1 = float(p1) print (p1) except: print('Bad Input') button_p1 = Button(text = 'ENTER',

How to set specific text to Entry in Python?

China☆狼群 提交于 2019-12-08 14:09:36
问题 I'm working on getting a python/tkinter label widget to update its contents. Per an earlier thread today, I followed instructions on how to put together the widgets. At runtime, however, the label widget does NOT change contents, when I click button Calculeaza. As far as I can tell, function Calculeaza() is wrong. def Calculeaza(self): cgrade =celsiusEntry.get() if cgrade == ' ': fahrenheitEntry.configure(text = ' ') else: cgrade=float(cgrade) fgrade=(cgrade-32)/1.8 fahrenheitEntry.configure

searching in treeview and highlight/select the row that contains the item that is searched

你离开我真会死。 提交于 2019-12-08 13:00:18
问题 I am making a simple GUI for a patient's list with patient's name and date of visiting, using tkinter and treeview, I have an entry where user should type the name of the patient and the idea is if the name of the patient is located in the list, the row (or rows) which contain patient's name to be highlighted(selected). Or the other option can be in the listbox with all patients, to display only the entries with the patient's name we search for. I have not used treeview before and could not

Python Tkinter Entry. I can't type Korean in to the Entry field

牧云@^-^@ 提交于 2019-12-07 07:33:46
问题 I am making a p2p chat program in Python 3 using Tkinter. I can paste Korean text into the Entry widget and send to the other user and it works. However, I can't 'type' Korean into the widget directly. Why is this happening? I am using Mac OS X Yosemite. 回答1: I would recommend using the translate module by pip install translate into your python shell. It uses google translate offline as a python module. It would work something like this: $ translate-kor -t zh "This is a pen." More details on

Tkinter check if entry box is empty

拥有回忆 提交于 2019-12-06 06:21:23
问题 How to check if a Tkinter entry box is empty? In other words if it doesn't have a value assigned to it. 回答1: You can get the value and then check its length: if len(the_entry_widget.get()) == 0: do_something() You can get the index of the last character in the widget. If the last index is 0 (zero), it is empty: if the_entry_widget.index("end") == 0: do_something() 回答2: If you are using StringVar() use: v = StringVar() entry = Entry(root, textvariable=v) if not v.get(): #do something If not

Python Tkinter Entry. I can't type Korean in to the Entry field

﹥>﹥吖頭↗ 提交于 2019-12-05 16:30:25
I am making a p2p chat program in Python 3 using Tkinter. I can paste Korean text into the Entry widget and send to the other user and it works. However, I can't 'type' Korean into the widget directly. Why is this happening? I am using Mac OS X Yosemite. I would recommend using the translate module by pip install translate into your python shell. It uses google translate offline as a python module. It would work something like this: $ translate-kor -t zh "This is a pen." More details on translate can be found at the link https://pypi.org/project/translate/ . Once you have this, you can

Python 3: Tkinter: How to change Entry.get() into an integer

こ雲淡風輕ζ 提交于 2019-12-05 12:35:53
I am coding a simple program which converts imperial units into metric units . However, when I use an Entry.get() command, I need to convert it to an integer and when I try to do that I get this error: Traceback (most recent call last): File "C:/Users/Bill/converter.py", line 18, in <module> conversion=int(e.get()) ValueError: invalid literal for int() with base 10: '' I tried running an extremely basic version of what I was doing (which is written below), but that still caused the same error. import tkinter root= tkinter.Tk() e=tkinter.Entry(root) e.pack() b=tkinter.Button(root, command=

Python Tkinter Entry get()

半城伤御伤魂 提交于 2019-12-03 21:02:04
I'm trying to use Tkinter's Entry widget. I can't get it to do something very basic: return the entered value. Does anyone have any idea why such a simple script would not return anything? I've tried tons of combinations and looked at different ideas. This script runs but does not print the entry: from Tkinter import * root = Tk() E1 = Entry(root) E1.pack() entry = E1.get() root.mainloop() print "Entered text:", entry Seems so simple. Edit: In case anyone else comes across this problem and doesn't understand, here is what ended up working for me. I added a button to the entry window. The