Pickle Problem

Fab86 fabien.hall at gmail.com
Tue Mar 3 13:00:04 CET 2009


Fantastic, just what I was looking for Andrew.

Many thanks,

Fabien

On Mar 3, 11:50 am, "andrew cooke" <and... at acooke.org> wrote:
> Fab86 wrote:
> > I am wanting to store the integers in a file so that I can then run it
> > through some software without having to edit it. Will json enable me
> > to do this?
>
> no.  ignore json - it is for something else entirely.
>
> all you need to do is to write the numbers out to a file:
>
> f = open('file.txt', 'w')
> f.write('%d\n' % 123)
> f.write('%d\n' % 456)
> f.close()
>
> for an explanation of the "%" seehttp://docs.python.org/library/stdtypes.html#index-1680
>
> the '\n' is a newline character so that after each number a new line is
> started.
>
> andrew
>
> > Thanks again,
>
> > Fabien
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
>




More information about the Python-list mailing list