Re: How to covert ASCII to integer in Python?



On May 30, 10:03�am, Philipp Pagel <pDOTpa...@xxxxxxxxxxxxxxxxxxxxx>
wrote:
Skonieczny, Chris <Skonieczn...@xxxxxxxxxxxxx> wrote:
YOU SHOULD REMOVE or CORRECT YOUR POST here:
http://mail.python.org/pipermail/python-list/2007-February/427841.html�;

It is not true - eg. try :
a='P' � � � � � �# P is ASCII , isn't it ?
b=int(a)
and what you will get ? An error !!!

'P' is obviously not an ASCII representation of a number.

It is in base 36.

a='P'
b=int(a,36)
b
25


What did you expect? The closest number by visual appearance?

cu
� � � � Philipp

--
Dr. Philipp Pagel
Lehrstuhl f. Genomorientierte Bioinformatik
Technische Universit�t M�nchenhttp://mips.gsf.de/staff/pagel

.



Relevant Pages

  • Re: updating with aptitude
    ... Lehrstuhl f. ... Genomorientierte Bioinformatik ... Technische Universität München ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: How to pass shell variable to shell script from python
    ... Dr. Philipp Pagel ... Lehrstuhl f. ... Genomorientierte Bioinformatik ... Technische Universität München ...
    (comp.lang.python)
  • Re: (OT) Nokia Buys Trolltech
    ... In comp.os.linux.misc draeath wrote: ... Lehrstuhl f. ... Genomorientierte Bioinformatik Fax. +49-8161-71 2186 ... Technische Universität München ...
    (comp.os.linux.misc)
  • Re: Very simple S+ command?
    ... how can I change the above cat command? ... Lehrstuhl f. ... Genomorientierte Bioinformatik ... Technische Universität Münchenhttp://mips.gsf.de/staff/pagel ...
    (sci.stat.math)
  • Re: Very simple S+ command?
    ... how can I change the above cat command? ... Lehrstuhl f. ... Genomorientierte Bioinformatik ... Technische Universität München ...
    (sci.stat.math)