Advertisement
Guest User

Untitled

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