multithreading - threading.Lock() not working through script -
i'm experimenting threading function in python 3 own pingtesting app/log working, im following youtube tutorial
when i've launched python 3 interpreter, , run:
>>> import threading >>> print_lock = threading.lock() it correctly returns
>>> print_lock <_thread.lock object @ 0x042093c8> but when use piece of code in script , try run as
python scriptname.py i error saying attribute lock() doesn't exist
attributeerror: 'module' object has no attribute 'lock' how possible? i've verified threading.lock() returns when running python interpreter, why isn't recognized when try run in script , how can running?
did happen name module (or module in working directory) threading.py? imported ahead of built-in threading, causing exact problem.
trying running:
print(threading.__file__) in module, suspect you'll find it's not python built-in.
Comments
Post a Comment