You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
354 B
20 lines
354 B
import threading
|
|
import time
|
|
|
|
def genera_eventos():
|
|
for x in range (5):
|
|
time.sleep(2)
|
|
ev.set()
|
|
|
|
def escribe_algo():
|
|
while (True):
|
|
ev.wait()
|
|
print ("hola")
|
|
ev.clear()
|
|
|
|
ev = threading.Event()
|
|
T1 = threading.Thread(target=genera_eventos)
|
|
T2 = threading.Thread(target=escribe_algo)
|
|
|
|
T1.start()
|
|
T2.start() |