[SciPy-user] Saving Data as Modul!!

Christian Meesters meesters at uni-mainz.de
Mon Nov 6 10:01:28 CST 2006

Alright, I shouldn't have written that nobody has done it. (Although I(!) 
think is runs under 'obfuscation enhanced'.) I certainly did not want to 
start a discussion on the separation of data and code. In fact my answer was 
a bit presumptuous, since I didn't comment on the actual question - please 
ignore my last post.


> 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:
> http://www.egenix.com/files/python/pyar.py
> http://www.daniweb.com/code/snippet394.html

More information about the SciPy-user mailing list