simple Tkinter Question

duikboot adijkstra at baanders NOSPAM consultancy.nl
Tue Oct 5 03:43:51 EDT 2004


Maboroshi wrote:
> Hi I was curious how I can pass arguments through a Tkinter Entry widget
> 
> say I have an Entry widget and a Button widget I enter text into the 
> entry and now I want the button to process the text is there a certain 
> command I have to use to assign the button to the entry or vise versa
> 
> anyhelp appreciated

Take a look at 
http://www.pythonware.com/library/tkinter/introduction/index.htm

example

from Tkinter import *

def pr_text():
     text = entry.get()
     print text

gui=Tk()
entry=Entry(gui)
entry.pack()
button=Button(gui, text="print", command=pr_text)
button.pack()

gui.mainloop()


-- 
http://www.baandersconsultancy.nl | http://www.nosonis.com



More information about the Python-list mailing list