Threading - příklad import threading, time class Stopky(threading.Thread): def __init__(self, nazev, cas): self.nazev = nazev self.cas = cas threading.Thread.__init__(self) def run(self): while self.cas > 0: print self.nazev, self.cas self.cas -= 1 time.sleep(1) print Konec threadu , self.nazev s1 = Stopky( stopky A , 7) s2 = Stopky( stopky B , 4) s1.start() s2.start() time.sleep(10) print Konec hlavniho programu
{}