Advertisement
Guest User

Untitled

a guest
Jul 31st, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. from Tkinter import *
  2.  
  3. master = Tk()
  4.  
  5. e = Entry(master)
  6. e.pack()
  7.  
  8. e.focus_set()
  9.  
  10. def callback():
  11.     print e.get()
  12.  
  13. b = Button(master, text="get", width=10, command=callback)
  14. b.pack()
  15.  
  16.  
  17. output = Text(master)
  18. output.pack()
  19.  
  20. mainloop()
  21. e = Entry(master, width=50)
  22. e.pack()
  23.  
  24.  
  25.  
  26. text = e.get()
  27.  
  28.  
  29. def makeentry(parent, caption, width=None, **options):
  30.     Label(parent, text=caption).pack(side=LEFT)
  31.     entry = Entry(parent, **options)
  32.     if width:
  33.         entry.config(width=width)
  34.     entry.pack(side=LEFT)
  35.     return entry
  36.  
  37. output_content = StringVar()
  38. output = Text(master, textvariable=output_content)
  39. output.pack()
  40. output.insert('1.0', 'my status here.\n')
  41.  
  42.  
  43. user = makeentry(parent, "User name:", 10)
  44. password = makeentry(parent, "Password:", 10, show="*")
  45. content = StringVar()
  46. entry = Entry(parent, text=caption, textvariable=content)
  47.  
  48. text = content.get()
  49. content.set(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement