dhylands / usb-ser-mon

Auto connect to USB Serial devices.
MIT License
48 stars 29 forks source link

Added support for python3 #6

Closed kapacuk closed 4 years ago

kapacuk commented 4 years ago

Hi Dave,

You've done a great job on this monitor, but it did not work with python3, mostly because serial port does not accept unicode strings, only sequences of bytes. I ported it to python3, trying to preserve the backward compatibility, so that the same script still works with python2. Hope you accept this change, let me know if you have any questions.

Regards, Dima.

kapacuk commented 4 years ago

I'd like to see the very first line say: #!/usr/bin/env python3 if we're going to update this to python3.

Thanks for doing this. Switching to python3 has been on my TODO list for quite a while.

If you want to drop support for python2 then the code could be simplified significantly. I tried to keep it py2-compatible, that's why I did not enforce the python version.

davehylands commented 4 years ago

I'm happy to totally drop support for python2 (I can provide a tag for the current version if somebody really wants python2 support).

kapacuk commented 4 years ago

I'm happy to totally drop support for python2 (I can provide a tag for the current version if somebody really wants python2 support).

OK, let me simplify it a bit, I'll submit another PR.