I am implementing a client server program.
Client side is written in C++ it sends to a phyton server packets.
For example the phyton buffer receive:
datarecv = 'i\001\017\000\001\000\334\005...'
Where every part between backslash is a byte.
My problem is to make phyton understand as a number the fields because some are bytes some are words and some Dword
for example i want that \001\ is read like an unsigned char (it means 1 in decimal notation) or \017\000 like a word (it means 15 in decimal notation!).
I know that there's the struct module to do this, but i wanted to know if there's a method with the built-in functions!!
Thanks a lot
Lucio
Client side is written in C++ it sends to a phyton server packets.
For example the phyton buffer receive:
datarecv = 'i\001\017\000\001\000\334\005...'
Where every part between backslash is a byte.
My problem is to make phyton understand as a number the fields because some are bytes some are words and some Dword
for example i want that \001\ is read like an unsigned char (it means 1 in decimal notation) or \017\000 like a word (it means 15 in decimal notation!).
I know that there's the struct module to do this, but i wanted to know if there's a method with the built-in functions!!
Thanks a lot
Lucio