[個人メモ] 定形だがたまに忘れるのでメモ.
dump.py
import gzip
import cPickle
obj = 1
with gzip.open('test.pkl.gz', 'wb') as gf:
cPickle.dump(obj, gf, cPickle.HIGHEST_PROTOCOL)
load.py
with gzip.open('test.pkl.gz', 'rb') as gf:
x = cPickle.load(gf)
Go to list of users who liked
More than 5 years have passed since last update.
[個人メモ] 定形だがたまに忘れるのでメモ.
import gzip
import cPickle
obj = 1
with gzip.open('test.pkl.gz', 'wb') as gf:
cPickle.dump(obj, gf, cPickle.HIGHEST_PROTOCOL)
with gzip.open('test.pkl.gz', 'rb') as gf:
x = cPickle.load(gf)
Register as a new user and use Qiita more conveniently
Go to list of users who liked