Sep-30-2020, 01:17 PM
Good morning....
I have a string being returned '@S0601\r\n'.....I am trying to remove the @ at the front using .replace and .lstrip but to no avail....Below is my lastest code try with error that I seem to get on both .replace or .lstrip....Can someone tell me what I am doing wrong?
I have a string being returned '@S0601\r\n'.....I am trying to remove the @ at the front using .replace and .lstrip but to no avail....Below is my lastest code try with error that I seem to get on both .replace or .lstrip....Can someone tell me what I am doing wrong?
print((s.read(int(k)).rstrip()).lstrip('@'))
Error:Traceback (most recent call last):
File "radar.py", line 16, in <module>
print((s.read(int(k)).rstrip()).lstrip('@'))
TypeError: a bytes-like object is required, not 'str'
Thanks