Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Hexadecimal Conversion in Python
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Grant Edwards, post: 1846227"] Eh? What's so difficult about it? Yet you seem unable to describe what it is you're trying to do. And what is it you _want_? If the other end sent you four ASCII "." bytes, shouldn't that be what you see? Sorry, I've no clue what "hexa, bin" is or how to convert to it. I have absolutely no idea what you're trying to do, but maybe this will help: In Python a "string" is an array of 8-bit bytes. If you want the integer equivalent of the 3rd byte in a string s, do this: b = ord(s[2]) For example: 67 If you want a list of the integer equivalents of the bytes in a string, do this: bl = [ord(c) for c in s] [65, 66, 67] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Hexadecimal Conversion in Python
Top