tkinter-entry

Tkinter dynamically create widgets from button

我只是一个虾纸丫 提交于 2019-12-02 22:46:51
问题 I'm attempting to make a dynamic GUI where clicking a button causes the creation of a new frame that is placed above the button with 3 entry widgets (user options) inside of it, and I need to be able to read the user input from the 3 entry widgets & possibly alter them. Each time the button is pressed, three new callable entry widgets should appear. I know that this is wrong because it has been giving me errors, but could something similar to the lists be used to create the widgets

Tkinter application 'freezes' while continually polling Pipe for contents (multiprocessing)

落爺英雄遲暮 提交于 2019-12-02 21:52:37
问题 I have two scripts: Processor_child.py : Its purpose is to perform a number of data analysis and cleaning operations. This must perform the same operations when run alone (without Tkinter_parent.py) as it does when packaged into a GUI with Tkinter_parent.py. Tkinter_parent.py : Its purpose is to provide a GUI for those who can't use Processor_child directly. Within Processor_child, there are for loops that ask the user for input on each iteration. These prompts need to appear in the Tkinter

How to pass Tkinter entry value from one frame to another through my switch frame function

孤人 提交于 2019-12-02 15:16:10
问题 My Tkinter application have added Notebook and inside the notebook I want to switch the frame using a button. Implemented notebook switch and frame switch. i want to take entry input from one frame of notebook to another frame when I click 'okay' button enter code here I tried to pass the value as argument for frame class initialization assign the entry filed value to a global variable In Frame : class Tab1_Frame1 want to pass value from self.uidentry = Entry(self, bd=5) to class Tab1_Frame2

How to get the text of Checkbuttons?

≯℡__Kan透↙ 提交于 2019-12-02 13:39:38
Checkbuttons gets generated dynamically and they are getting text from a python list. I need a logic for capturing selected checkbuttons text . As per my research everywhere they are returning the state of checkbox instead of text. Please help. cb_list =['pencil','pen','book','bag','watch','glasses','passport','clothes','shoes','cap'] try: r = 0 cl = 1 for op in cb_list: cb = Checkbutton(checkbutton_frame, text=op, relief=RIDGE) cb.grid(row=r, column=cl, sticky="W") r = r + 1 except Exception as e: logging.basicConfig(filename=LOG_FILENAME, level=logging.ERROR) logging.error(e) # print (e)

Tkinter application 'freezes' while continually polling Pipe for contents (multiprocessing)

ぃ、小莉子 提交于 2019-12-02 12:17:31
I have two scripts: Processor_child.py : Its purpose is to perform a number of data analysis and cleaning operations. This must perform the same operations when run alone (without Tkinter_parent.py) as it does when packaged into a GUI with Tkinter_parent.py. Tkinter_parent.py : Its purpose is to provide a GUI for those who can't use Processor_child directly. Within Processor_child, there are for loops that ask the user for input on each iteration. These prompts need to appear in the Tkinter app, accept the input, and send it back to Processor_child. The code below does this, raising an Entry

How to pass Tkinter entry value from one frame to another through my switch frame function

ε祈祈猫儿з 提交于 2019-12-02 09:46:28
My Tkinter application have added Notebook and inside the notebook I want to switch the frame using a button. Implemented notebook switch and frame switch. i want to take entry input from one frame of notebook to another frame when I click 'okay' button enter code here I tried to pass the value as argument for frame class initialization assign the entry filed value to a global variable In Frame : class Tab1_Frame1 want to pass value from self.uidentry = Entry(self, bd=5) to class Tab1_Frame2 import tkinter as tk from tkinter import * from tkinter import ttk # Root class to create the interface

Python: How to get an updated Entry text to use in a command binded to it?

て烟熏妆下的殇ゞ 提交于 2019-12-02 04:28:22
Consider the following code: text = Entry(); text.pack() def show(e): print text.get() text.bind('<Key>', show) Let's say I put the letters ABC in the Entry, one by one. The output would be: >>> >>> A >>> AB Note that when pressing A, it prints an empty string. When I press B, it prints A, not AB. If i don't press anything after C, it will never be shown. It seems that the Entry content is only updated after the binded command has returned, so I can't use the actual Entry value in that function. Is there any way to get an updated Entry value to use inside a binded command? You could replace

How to display an output using entry widget in Python?

微笑、不失礼 提交于 2019-12-01 14:02:28
How can I display an output through Entry Widget. Let say I am adding 2 numbers and wanted to display their sum in a textbox using entry widget. from tkinter import * from tkinter.messagebox import * def show_answer(): Ans = int(num1.get()) + int(num2.get()) ans.set(Ans) Entry(main, text = "%s" %(ans) ).grid(row=2, column=1) main = Tk() Label(main, text = "Enter Num 1:").grid(row=0) Label(main, text = "Enter Num 2:").grid(row=1) Label(main, text = "The Sum is:").grid(row=2) num1 = Entry(main) num2 = Entry(main) blank = Entry(main) num1.grid(row=0, column=1) num2.grid(row=1, column=1) blank

How to display an output using entry widget in Python?

久未见 提交于 2019-12-01 12:42:06
问题 How can I display an output through Entry Widget. Let say I am adding 2 numbers and wanted to display their sum in a textbox using entry widget. from tkinter import * from tkinter.messagebox import * def show_answer(): Ans = int(num1.get()) + int(num2.get()) ans.set(Ans) Entry(main, text = "%s" %(ans) ).grid(row=2, column=1) main = Tk() Label(main, text = "Enter Num 1:").grid(row=0) Label(main, text = "Enter Num 2:").grid(row=1) Label(main, text = "The Sum is:").grid(row=2) num1 = Entry(main)

How do you check if a widget has focus in Tkinter?

瘦欲@ 提交于 2019-11-30 17:52:05
from Tkinter import * app = Tk() text_field = Entry(app) text_field.pack() app.mainloop() I want to be able to check if text_field is currently selected or focused, so that I know whether or not to do something with its contents when the user presses enter. If you want to do something when the user presses enter only if the focus is on the entry widget, simply add a binding to the entry widget. It will only fire if that widget has focus. For example: import tkinter as tk root = tk.Tk() e1 = tk.Entry(root) e2 = tk.Entry(root) e1.pack() e2.pack() def handleReturn(event): print("return: event