convert binary data to int
Peter Otten
__peter__ at web.de
Wed Jan 10 05:20:33 EST 2007
More information about the Python-list mailing list
Wed Jan 10 05:20:33 EST 2007
- Previous message (by thread): convert binary data to int
- Next message (by thread): convert binary data to int
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
rubbishemail at web.de wrote: > I need to convert a 3 byte binary string like > "\x41\x00\x00" to 3 int values ( (65,0,0) in this case). > The string might contain characters not escaped with a \x, like > "A\x00\x00" >>> [ord(c) for c in "A\x00\x41"] [65, 0, 65] For more complex conversions look into the struct module. Peter
- Previous message (by thread): convert binary data to int
- Next message (by thread): convert binary data to int
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list