danielkucera / cyusb3014-breakout

7 stars 4 forks source link

Quick fix for Python3 #1

Open mcuee opened 2 years ago

mcuee commented 2 years ago

I just made a simple fix here to get the python code working under Python 3. https://github.com/mcuee/python_usb/blob/master/cyusb_fx3_loopback-test_python3.py

mcuee commented 2 years ago

BTW, I also use your codes to create a new code to test the BulkSrcSink FW. https://github.com/mcuee/python_usb/blob/master/cyusb_fx3_sourcesink_python3.py

danielkucera commented 2 years ago

yes, the obvious print() ... what is the difference between thread and _thread ?

mcuee commented 2 years ago

Not a python expert but I found the following. https://stackoverflow.com/questions/36809788/importerror-no-module-named-thread In Python 3 instead of:

import thread

Do:

import _thread
mcuee commented 2 years ago

Maybe the better fix is to use threading module. https://www.tutorialspoint.com/python3/python_multithreading.htm