I am developing web application through Django/Python framework on Raspberry Pi platform running Debian Linux and Python 2.7.9 .
I have to use multiple threads in Python script to handle multiple peripherals such as camera and microphone. These peripherals must be handled in real time.
I wonder why I can issue "import thread" but not "import threading" in my Python script (does not matter whether it is Python version 2.x or 3.x) ?
pi@raspberrypi:~ $ python --version
Python 2.7.9
pi@raspberrypi:~ $ python ./mythread.py
Traceback (most recent call last):
File "./mythread.py", line 4, in <module>
from threading import Thread
File "/home/pi/threading.py", line 8, in <module>
del _sys.modules[__name__]
AttributeError: 'module' object has no attribute 'Thread'
pi@raspberrypi:~ $ python3 ./mythread.py
Traceback (most recent call last):
File "./mythread.py", line 4, in <module>
from threading import Thread
ImportError: bad magic number in 'threading': b'\x03\xf3\r\n'