ASCII to HEX conversion

Matt leisinmr at purdue.edu
Thu Apr 11 18:15:36 EDT 2002


I need to write a program that converts ASCII test into the
hexidecimal equivalent.  It would help if it could convert to binary,
too.

Example:

ASCII = "A"
HEX = 41

I tried using the hex() function, but it does not work.  If anyone
could tell me how to do this without making a lookup table of all the
ASCII values.


Matt Leisinger
leisinmr at purdue.edu



More information about the Python-list mailing list