Reading/Writing files

Jack Trades jacktradespublic at gmail.com
Fri Mar 18 18:24:42 EDT 2011


On Fri, Mar 18, 2011 at 5:21 PM, Jon Herman <jfc.herman at gmail.com> wrote:

> Folks,
>
> thanks for the many responses! Specifying the full file name (and not using
> parentheses when inappropriate, thanks Jack :)) I am now happily
> reading/writing files.
>
> My next question: what is the best way for me to write an array I generated
> to a file?
> And what is the best way for me to load that array again, the next time I
> start up my computer?
>
> Basically I am doing very large computations and want to store the results.
>
> Thanks a lot guys!
>
> Jon
>
>
To save a data structure like an array (called a list in Python), you can
use the pickle module.  Here's the documentation on pickle.

http://docs.python.org/library/pickle.html
http://www.developertutorials.com/tutorials/python/python-persistence-management-050405-1306/


-- 
Jack Trades
Pointless Programming Blog <http://pointlessprogramming.wordpress.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110318/c3f42244/attachment-0001.html>


More information about the Python-list mailing list