How to covert ASCII to integer in Python?

Larry Bates lbates at websafe.com
Thu Feb 22 12:48:18 EST 2007


John wrote:
> Is there any built in function that converts ASCII to integer or vice versa
> in Python?
> 
> Thanks!
> 
> 
You probably should go through the tutorial ASAP that is located here:

http://docs.python.org/tut/


Convert ascii string to integer:

a='1'
b=int(a)

Convert integer to ascii string:

a=1
b=str(a)

or

a=1
b="%i" % a

-Larry Bates




More information about the Python-list mailing list