Python snippet : TSP01 - Rev B - using ctypes.py
When using 2 devices the code enters an else statement which handles multiple devices.
At Line 33
there is an print statement:
print('#' + str(i + 1) + " " + deviceName.value) This fails because deviceName.value must be decoded first.
Suggested change:
print('#' + str(i + 1) + " " + deviceName.value.decode())
Line 35:
lib.TLTSPB_getRsrcName(0, (device_num - 1), deviceName) fails because the user input is a string, not an integer to substract from.
Suggested change:
lib.TLTSPB_getRsrcName(0, (int(device_num) - 1), deviceName)
Python snippet : TSP01 - Rev B - using ctypes.py
When using 2 devices the code enters an else statement which handles multiple devices.
At Line 33
there is an print statement:
print('#' + str(i + 1) + " " + deviceName.value)This fails because deviceName.value must be decoded first.Suggested change:
print('#' + str(i + 1) + " " + deviceName.value.decode())Line 35:
lib.TLTSPB_getRsrcName(0, (device_num - 1), deviceName)fails because the user input is a string, not an integer to substract from.Suggested change:
lib.TLTSPB_getRsrcName(0, (int(device_num) - 1), deviceName)