Closed JBSchueler closed 5 years ago
This is not a driver issue but I am unable to find the right answer.
outputStr = bytearray([123, 32, 12, 1, 245]) for h in outputStr: sp.write( h )
this gives an error...
outputStr = bytearray([123, 32, 12, 1, 245]) for h in outputStr: sp.write( sp.write( (format(h, "c")) ) )
Now I get a TypeError
Traceback (most recent call last): File "ftwrite.py", line 79, in <module> sp.write( (format(h, "c")) ) File "C:\Users\bsc\AppData\Local\Programs\Python\Python37\lib\site-packages\ft232\d2xx.py", line 339, in write buf = c.create_string_buffer(s) File "C:\Users\bsc\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 63, in create_string_buffer raise TypeError(init) TypeError: ª
So I tried
outputStr = bytearray([123, 32, 12, 1, 245]) for h in outputStr: sp.write( chr(h).encode('utf-8') )
Now I am able to print but for none-ascii chars I get 2 bytes
Can someone help me to just send raw bytes?
Uhm... problem solved...
sp.write( bytes(outputStr) )
This is not a driver issue but I am unable to find the right answer.
this gives an error...
Now I get a TypeError
So I tried
Now I am able to print but for none-ascii chars I get 2 bytes
Can someone help me to just send raw bytes?