Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. from tkinter import *
  2. import os
  3.  
  4. root=Tk()
  5. root.geometry('350x100')
  6. root.title("Spegnimento automatico")
  7. root.resizable(0,0)
  8.  
  9. def shutdown():
  10. sec=v.get()
  11. os.system('shutdown -s -t', sec)
  12.  
  13. def shutdownFalse():
  14. os.system('shutdown -a')
  15.  
  16. mLabel=Label(text="Inserisci Tempo in secondi")
  17. mLabel.place(x= 100, y=0)
  18. v=StringVar()
  19. mEntry=Entry(root, textvariable=v)
  20. mEntry.place(x= 110, y= 25)
  21. mButton=Button(text= 'Conferma', command= shutdown)
  22. mButton.place(x=90, y=50)
  23. mButtonFalse=Button(text= "Annulla", command= shutdownFalse)
  24. mButtonFalse.place(x=210, y=50)
  25.  
  26. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement