Why is
struct.pack("!bbbb", 0x2, r, g, b)
failing in my python code when r, g, or b is > 127?
I know that the "b" means the size of a given value is 1 byte according to the struct docs, but why does it fail with values over 127?
127? I know that the "b" means the size of a given value is 1" /> 127? I know that the "b" means the size of a given value is 1" /> 127? I know that the "b" means the size of a given value is 1"/>
Why is
struct.pack("!bbbb", 0x2, r, g, b)
failing in my python code when r, g, or b is > 127?
I know that the "b" means the size of a given value is 1 byte according to the struct docs, but why does it fail with values over 127?
Copyright © 2021 Jogjafile Inc.
According to the documentation,
bstands for:which means its valid range is [-128, 127]. And that's what the error messages says explicitly:
Using
Byields no error: