python - How to 'pickle' an object to a certain directory? -


normally, executing following code pickle object file in current directory:

fp = open('somefile.txt', 'wb') pickle.dump(object, fp) 

how re-direct output pickle.dump different directory?

with open('/full/path/to/file', 'wb') f:     pickle.dump(object, f) 

Comments