We Recommend

Learning Python Learning Python
The authors of Learning Python show you enough essentials of the Python scripting language to enable you to begin solving problems right away, then reveal more powerful aspects of the language one at a time. This approach is sure to appeal to programmers and system administrators who have urgent problems and a preference for learning by semi-guided experimentation.


Posted By

buscarini on 07/18/06


Tagged


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

yuconner
anayhk


Interfaz de grabación


Published in: Python 


  1. from Tkinter import *
  2.  
  3. class App:
  4. def __init__(self,master):
  5.  
  6. frame = Frame(master)
  7. frame.pack()
  8.  
  9. self.button = Button(frame,text = "Quit",fg = "red", command=frame.quit)
  10. self.button.pack(side=LEFT)
  11.  
  12. self.hi_there = Button(frame,text="Start",command=self.start)
  13. self.hi_there.pack(side=LEFT)
  14.  
  15. self.hi_there = Button(frame,text="Stop",command=self.stop)
  16. self.hi_there.pack(side=LEFT)
  17.  
  18. self.archivo = StringVar()
  19. self.textField = Entry(frame,textvariable=self.archivo)
  20. self.textField.pack()
  21. self.hi_there.pack(side=RIGHT)
  22.  
  23.  
  24. def start(self):
  25. print("starting")
  26.  
  27. def stop(self):
  28. print("stopping")
  29.  
  30. root = Tk()
  31.  
  32. app = App(root)
  33.  
  34. root.mainloop()

Report this snippet 

You need to login to post a comment.