tkinter-entry

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

泪湿孤枕 提交于 2020-01-06 06:39:31
问题 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

Python Tkinter Entry get()

谁都会走 提交于 2020-01-01 07:09:53
问题 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

How do I set the width of an Tkinter Entry widget in pixels?

徘徊边缘 提交于 2019-12-30 08:50:08
问题 I noticed that the width argument for the Tkinter entry widget is in characters, not pixels. Is it possible to adjust the width in pixels? 回答1: You cannot specify the worth in pixels using the '-width' option, but there are ways to accomplish the same thing. For example, you could pack an entry in a frame that has no border, turn off geometry propagation, then set the width of the frame in pixels. 回答2: You can also use the Place geometry manager: entry.place(x=10, y=10, width=100) #width in

tkinter python entry height

你。 提交于 2019-12-29 06:59:36
问题 I'm making a simple app just to practice python in which I want to write text as if it were Notepad. However, I can't make my entry bigger. I'm using tkinter for this. Does anybody know how to make the height of an entry bigger? I tried something like this: f = Frame() f.pack() e = Entry(f,textvariable=1,height=20) e.pack() I know this doesn't work because there isn't a property of "height". However, I see that there is a width property. 回答1: It sounds like you are looking for tkinter.Text,

How to make a tkinter entry default value permanent

南楼画角 提交于 2019-12-25 18:53:43
问题 I am writing a program in python that will take in specific formats, a Phone number and dollar/cent values. How can I make tkinter have default value which is permanent, not deletable. For example (XXX)-XXX-XXXX? basically you can add an entry to the widget but the entry is defined the permanent value like when its empty it looks like (_ _ _)-___-____ when it has text it looks like (434)-332-1234 回答1: If I understand you correctly, you want some sort of template in which a user can type his

How to make a tkinter entry default value permanent

筅森魡賤 提交于 2019-12-25 18:53:36
问题 I am writing a program in python that will take in specific formats, a Phone number and dollar/cent values. How can I make tkinter have default value which is permanent, not deletable. For example (XXX)-XXX-XXXX? basically you can add an entry to the widget but the entry is defined the permanent value like when its empty it looks like (_ _ _)-___-____ when it has text it looks like (434)-332-1234 回答1: If I understand you correctly, you want some sort of template in which a user can type his

My tkinter entry box is printing .!entry instead of what is entered

假装没事ソ 提交于 2019-12-25 17:38:19
问题 from tkinter import * def _name_(): businessname=entry_bn print(businessname) edit_bar=Tk() name=Label(edit_bar,text="Name:").grid(row=0) entry_bn=Entry(edit_bar) entry_bn.grid(row=0,column=1) submit=Button(edit_bar,text="Submit",command=_name_).grid(row=1,column=2) Whenever i press my submit button, i get .!entry printed out, instead of what is entered into the entry box. Any ideas? Thank you 回答1: Question : i get .!entry printed out, instead of what is entered into the Entry Reference :

My tkinter entry box is printing .!entry instead of what is entered

穿精又带淫゛_ 提交于 2019-12-25 17:37:26
问题 from tkinter import * def _name_(): businessname=entry_bn print(businessname) edit_bar=Tk() name=Label(edit_bar,text="Name:").grid(row=0) entry_bn=Entry(edit_bar) entry_bn.grid(row=0,column=1) submit=Button(edit_bar,text="Submit",command=_name_).grid(row=1,column=2) Whenever i press my submit button, i get .!entry printed out, instead of what is entered into the entry box. Any ideas? Thank you 回答1: Question : i get .!entry printed out, instead of what is entered into the Entry Reference :

Using StringVar data as a list

前提是你 提交于 2019-12-25 07:49:29
问题 I've been following this website for a while. It is really helpful. So, thanks for all the useful tips. I've been searching for this answer for the past two weeks without any success, so now I'm compelled to ask out of total frustration with my current obstacle. How do you use StringVar as a list? Basically, I was coding the following program for my wife. The code is pretty messy as it is my first program I've tried to code. The idea was that I would take 3 variables; password, secret number

How do I check if any entry boxes are empty in Tkinter?

扶醉桌前 提交于 2019-12-25 01:50:03
问题 I am making a GUI in Tkinter with Python 2.7. I have a frame with about 30 entry boxes among other things. I don't have access to the code right now, but is there a way to check if any or several of the boxes are empty so I can warn the user and ask them if they want to proceed? Is there a way to go through each of them with a 'for' loop and check the length of each entry. Or is there a command to check if any box is empty? 回答1: You can get the content of the entry using Tkinter.Entry.get