SoftwareOscilloscope icon indicating copy to clipboard operation
SoftwareOscilloscope copied to clipboard

Works with Qt5/python3.

Open dilawar opened this issue 5 years ago • 4 comments

  • Requires PyQt5.
  • Does not require PySide (does not support >3.4)
  • Works with Python3.
  • Added couple of scripts for easy testing.

dilawar avatar Jun 15 '19 15:06 dilawar

Thanks for this! I was thinking we could drop Python 2 support entirely

suyashb95 avatar Jun 15 '19 16:06 suyashb95

You can release one final version for python 2 or tag a commit before dropped my py2 support. PyQt5 does not work with python2 (I guess).

On 15 June 2019 9:40:16 PM IST, Suyash Behera [email protected] wrote:

Thanks for this! I was thinking we could drop Python 2 support entirely

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/Suyash458/SoftwareOscilloscope/pull/2#issuecomment-502378963

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

dilawar avatar Jun 16 '19 05:06 dilawar

The test run fails with an AttributeError while running on Python 3 (Windows)

Traceback (most recent call last):
  File "test_run.py", line 5, in <module>
    plot.start()
  File "E:\Projects\Python\SoftwareOscilloscope\SoftOscilloscope.py", line 79, in start
    self.plot_init()
  File "E:\Projects\Python\SoftwareOscilloscope\SoftOscilloscope.py", line 57, in plot_init
    trial_data = self.readline().split(',')
  File "E:\Projects\Python\SoftwareOscilloscope\SoftOscilloscope.py", line 51, in readline
    return self.stream.readline().decode('utf8', errors='ignore').rstrip()
AttributeError: 'str' object has no attribute 'decode'

readline() should always return a string, right? Why do we have to decode it again?

suyashb95 avatar Jul 01 '19 03:07 suyashb95

readline() should always return a string, right? Why do we have to decode it again?

pyserial on unix platforms (Linux/OSX) returns bytes. I guess, we have to type check and call different functions or use try, except block.

dilawar avatar Jul 01 '19 04:07 dilawar