Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. from threading import Thread
  2. from Tkinter import *
  3. from time import sleep
  4.  
  5.  
  6. class _timeout(Thread):
  7.     def __init__(self, finestra):
  8.         Thread.__init__(self)
  9.         self.finestra = finestra
  10.  
  11.     def run(self):
  12.         sleep(5)
  13.         print('asd')
  14.         self.finestra.destroy()
  15.  
  16.  
  17. class AppBase:
  18.     def __init__(self, titolo):
  19.         self.finestra = Tk()                              
  20.         self.finestra.title(titolo)                  
  21.         quadro1 = Frame(self.finestra)
  22.         my_thread = _timeout(self.finestra)
  23.         my_thread.start()
  24.         self.finestra.mainloop()
  25.  
  26. AppBase('test multi')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement