colinoflynn / pico-python

PicoScope Python Interface
Other
102 stars 79 forks source link

Error durring ps5000a instanciation (python 3.x) #169

Closed elechapt closed 2 years ago

elechapt commented 3 years ago

The following command ps = ps5000a.PS5000a(serial_number) fails with python 3.x. The reason seems to be related to the line 139 in ps5000a.py and the following : https://stackoverflow.com/questions/7237133/create-string-buffer-throwing-error-typeerror-str-bytes-expected-instead-of-str I propose to replace serialNullTermStr = create_string_buffer(sn) by serialNullTermStr = create_string_buffer(bytes(sn, encoding='utf-8')) in the file. This issue arise here because I'm using this picoscope, but it mignt appear elswhere.

BenediktBurger commented 3 years ago

With #176 and #173 this issue can be closed. At least with the ps4000a series it works flawlessly. @hmaarrfk