[SciPy-user] Saving Data as Modul!!

Andrew Straw strawman at astraw.com
Mon Nov 6 09:29:09 CST 2006

Christian Meesters wrote:
> Hoi Volker,
> I agree with Gael, shelve is a nice modul, but nothing similar to what you 
> were asking for. Frankly, I doubt such a concept is hacked into code anywere.
> shelve, pickle or other modules might indeed serve you, but exporting code 
> probably isn't what you are looking for.
> Your question looks like one that would be better answered by
> describing what you are trying to do. You might want to describe your actual 
> problem rather than a solution you thought of. (what kind of data are you 
> dealing with? how 'much' data do you have? is it 'plain' data or some blobs? 
> and so on)
> Cheers
> Christian
Actually I've done what Volker asks in several different ways, although
none of the solutions is general enough to post here. The most fun
instance was saving electrophysiology recordings to a .py file such that
I could double-click the file and have the __main__ function plot the
data! In fact, now that I think about it, I've constructed most of my
examples to operate in this way -- run the .py file as a script and see
the data it contains in some kind of visualization. "import" it and use
it in another module. The nice thing about making it a module is that it
goes along for the ride with distutils without you having to even think
about it.

A couple of other ideas:

More information about the SciPy-user mailing list