apppublic/appPublic/pickleUtils.py
2020-07-12 16:04:02 +08:00

17 lines
286 B
Python

import pickle
def saveData(fn,*args):
f = open(fn,'wb')
a = [ pickle.dump(arg,f) for arg in args ]
f.close()
def loadData(fn,cnt):
a = [None] * cnt
try:
f = open(fn,'rb')
a = [ pickle.load(f) for i in range(cnt) ]
f.close()
return a
except:
return a