Reputation: 197
from _thread import *
def worker():
print("this is a new thread")
start_new_thread(worker, ())
In the above python code it is printing none ,and i dont know why this happens
Upvotes: 0
Views: 44
Reputation: 143
You could try putting your def and print function on the same line like this:
from _thread import *
def worker(): print("this is a new thread")
start_new_thread(worker, ())
Which output
18756
this is a new thread
Upvotes: 1