Mam ten kod, jak mogę zatrzymać func2 z func1? coś Thread(target = func1).stop()
nie działaZatrzymaj wątek 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()
Ale gdy chcę na przykład użyć raw_input na koniec func1. Wtedy func2 nie może zamknąć func1. Czy istnieje jakieś rozwiązanie? –