ho questo codice, come posso interrompere func2 da func1? qualcosa come Thread(target = func1).stop()
non funzionaStop a thread Python
import threading
from threading import Thread
def func1():
while True:
print 'working 1'
def func2():
while True:
print 'Working2'
if __name__ == '__main__':
Thread(target = func1).start()
Thread(target = func2).start()
Ma quando voglio per esempio utilizza raw_input alla fine del func1. Quindi func2 non può chiudere func1. C'è qualche soluzione per questo? –