I am going to use threading in my Python application. Assume I want to run worker() function in a thread using below codes in main.py file:
def threadcalling():
t = threading.Thread(target=worker())
threads.append(t)
t.start()
and my worker function in work.py file is such as this:
def worker():
"""thread worker function"""
print 'Worker'
return
My question: If the worker() function is in the same .py file which I am calling that, every thing is ok, But if the worker() function is in a another .py file which I have imported that in my main script using import command, I got this error:
<type 'exceptions.ValueError'>