Converting a string of one char into the ASCII equivalent?

Sean Hummel seanh at unforgettable.com
Mon May 10 20:45:40 EDT 1999


I've been looking for a good way to convert a 1 length string into a signed
byte equivalent.  Unfortunately the string library functions for converting
a string into a number, of course only work with string representations of a
number.  Thus if the string I have was "\300" then the atoi(), long(), and
int() functions all complain that the string isn't a number.

Is there a function which will give me the signed byte equivalent of the 1
char string?




More information about the Python-list mailing list