How to covert ASCII to integer in Python?

keirr keir.robinson at gmail.com
Thu Feb 22 12:48:51 EST 2007


On Feb 22, 5:43 pm, "John" <rds1... at sh163.net> wrote:
> Is there any built in function that converts ASCII to integer or vice versa
> in Python?
>
> Thanks!

Try int.
ie.

try:
   int_val = int(str_val)
except ValueError:
   # conversion failed

Keir.

--
Keir Robinson
Sometimes a scream is better than a thesis. (Emerson)





More information about the Python-list mailing list