Created
July 13, 2012 17:50
-
-
Save adrn/3106258 to your computer and use it in GitHub Desktop.
Python pipeline function sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import cPickle as pickle | |
def some_function(another_function, overwrite=False, *args, **kwargs): | |
if overwrite: | |
os.remove("somefilename.pickle") | |
if not os.path.exists("somefilename.pickle"): | |
# analysis / make object | |
object = another_function(*args, **kwargs) | |
f = open("somefilename.pickle", "w") | |
pickle.dump(object, f) | |
f.close() | |
f = open("somefilename.pickle", "r") | |
object = pickle.load(f) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment