I found the doc too brief. That’s why I asked. I only know Python. The doc says the method “Return a bytes object containing the values v1, v2, ...”. How is a bytes object different from a string?
A bytes object in python is just a string of bytes, not encoded like a str is. So struct helps to pack values as raw bytes — for example, on my code above (please don’t learn from it ^^"), it packs integer values into 4 bytes each
View all comments
Show parent comment
1
u/shiningmatcha Feb 21 '21
I found the doc too brief. That’s why I asked. I only know Python. The doc says the method “Return a bytes object containing the values v1, v2, ...”. How is a bytes object different from a string?