File write/read question

Nathan Hellmers nhellmers at yahoo.com
Tue May 14 08:44:56 EDT 2002


Alex Martelli <aleax at aleax.it> wrote in message news:<5uSD8.52715$zW3.722233 at news1.tin.it>...
> Nathan Hellmers wrote:
>         ...
> > that an integer written to a file is actually a string, but how do I
> > convert the string to an integer once I have read it with program #2?
>      ...
> > a = test2.readline()
> > int(a)
> 
> Just change this latter, isolated, useless expression statement into
> a rebinding of a:
> 
> a = int(a)
> 
> and there you are.
> 
> 
> Alex



Thanks!


Nathan



More information about the Python-list mailing list