(Jun-13-2020, 06:12 PM)Yoriz Wrote: Maybe this will suffice
File1.py:
import File2 while True: a = input() if a == "start": File2.run_func = True threading.Thread(target = File2.func).start() if a == "stop": #stop function File2.func File2.run_func = FalseFile2.py:
run_func = True def func(): while run_func: #do stuff
Is not working, i cannot update the value of File2.run_func into False. If I do:
print(File2.run_func)after run the line:
File2.run_func = Falsethe output is:
Output:True
instead of FalseEDIT: It works! Sorry, my mistake!Thank you all!