mix up between numbers and strings

Erik Max Francis max at alcyone.com
Tue Sep 5 19:28:34 EDT 2000


Jad Courbage wrote:

> The problem is that it seems that the interpreter "thinks" that narray
> is a
> string array
> although the file it is extracted from is a number data file.
> Therefore, I
> can't manipulate my data as numbers.

Use the builtin function int to convert strings to integers.  Remember,
Python is strongly typed -- the integer 1 is not the same thing as the
string '1'.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ A good indignation brings out all one's powers.
\__/ Ralph Waldo Emerson
    Fat Boy and Little Man / http://www.fatboyandlittleman.com/
 Watch Fat Boy and Little Man go about their antics.



More information about the Python-list mailing list