I want to define some globals in some work with the crunch of the number that I am doing, I gradually add a script and do not want the previous result to continue to load / recount. One approach is to split the mature code into a separate file and only python runinteractively new code. However, I just want to do this in a single file for development speed.
I was on the assumption that the global one defined in the file would persist between calls run, but they did not.
So my script has the following snippet if the code:
if globals().has_key('all_post_freq') != True:
print "creating all post freq var"
global all_post_freq
all_post_freq = all_post_freq_("pickle/all_post_freq.pickle")
How to save all_post_freq between calls ipython run
change
ok , , , : D