Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Tkinter import *
- master = Tk()
- e = Entry(master)
- e.pack()
- e.focus_set()
- def callback():
- print e.get()
- b = Button(master, text="get", width=10, command=callback)
- b.pack()
- output = Text(master)
- output.pack()
- mainloop()
- e = Entry(master, width=50)
- e.pack()
- text = e.get()
- def makeentry(parent, caption, width=None, **options):
- Label(parent, text=caption).pack(side=LEFT)
- entry = Entry(parent, **options)
- if width:
- entry.config(width=width)
- entry.pack(side=LEFT)
- return entry
- output_content = StringVar()
- output = Text(master, textvariable=output_content)
- output.pack()
- output.insert('1.0', 'my status here.\n')
- user = makeentry(parent, "User name:", 10)
- password = makeentry(parent, "Password:", 10, show="*")
- content = StringVar()
- entry = Entry(parent, text=caption, textvariable=content)
- text = content.get()
- content.set(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement