I try to launch this code on my computer and threading doesn't work:
import threading
def infinite_loop():
while 1 == 1:
pass
def myname():
print("chralabya")
t1 = threading.Thread(target=infinite_loop())
t2 = threading.Thread(target=myname())
t1.start()
t2.start()
When I execute this program myname()
is never executed. Can someone can explain to me why threading doesn't work?