string edit
-
This post is deleted!
-
This post is deleted!
-
This post is deleted!
-
@radossslaw a few comments, not related to the error message:
- The code piece you show has no line 54.
- the indentation of the first line seems to be wrong
But this starting section is odd:
num=data num=int(num) num=str(num) x=num[0] y=num[1:3]
It starts with data, which is a bytearray. Converting it to int() and back to str() makes it a string with whitespace stripped. You would get the same with: num = data.strip().decode(). Then you take two substrings, x and y.
These are not numbers. And I guess, that you uses these later in the code, e.g. in line 54, in a comparison with a number, which fails.
-
This post is deleted!
-
string is b'22' error is 2 line in this code
-
@radossslaw Please give an example of what the content of data is.
And does it simply not work, or do you get an error message?
Edit: And shouldn't you print int_x and int_y?