(Sep-30-2020, 01:17 PM)ridgerunnersjw Wrote: I have a string being returned '@S0601\r\n'I guess it's not a str object but bytes-like object, given that you have
s.read(int(k))
- we don't know what s
is...foo = b'@S0601\r\n' print(foo.rstrip().lstrip(b'@').decode()) print(foo.decode().rstrip().lstrip('@'))
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs