Saving Numeric arrays to file?

Duncan Smith buzzard at urubu.freeserve.co.uk
Sat Sep 27 15:41:20 CEST 2003


"Emile van Sebille" <emile at fenx.com> wrote in message
news:bl2ov9$78mdr$1 at ID-11957.news.uni-berlin.de...
> Duncan Smith asks about writing Numeric arrays to disk:
> >        [ 0,  0,  0,  5,  0,  0]])
> > >>> f = file('c:\Data\IS_rounded.txt', 'w')
> >
>
> Perhaps with 'wb' ?
>
> Emile van Sebille
> emile at fenx.com
>
>

It doesn't work for me.  Looks like I'll maybe have to avoid \n altogether,
use spaces to separate the strings and read characters individually.
Basically I have a few hundred thousand sets of 4 tables, each associated
with a unique key.  The idea was to store them as a text file so that I
could quickly fire them into a dictionary (memory permitting?) when I need
to use them.  Maybe I should be using MySQL for persistence?  What I *would*
like is a reasonably generic (and not terribly inefficient) solution for
storing strings that contain escape characters in text files.  Cheers.

Duncan






More information about the Python-list mailing list