read numbers from file and covert to integer

Peter Hansen peter at engcorp.com
Sun Jan 9 13:51:59 EST 2005


Øystein Western wrote:
> I got a file with a lot blocks of numbers that are strings. I'd like to read 
> all
> this numbers and convert them to numbers for futher compareation. How can I
> convert all this numbers to integer? Do I have to put all numbers into a 
> list?

It would help immensely if you could post some kind of
example of the sorts of data you are talking about,
perhaps a hex representation of the bytes (if it's
a binary file).  Otherwise we are just guessing how
you are using the terms "block", "number", "string",
and even "integer".

-Peter



More information about the Python-list mailing list