I'm new in python and i wanted to know if there is a solution for this problem:
I know that this may sound strange but i want to save the pickle.dump data into a variable.
I begin to think that may i could bypass it by making a fake class to instead of writing in a file, writing in a variable:
class PickleDatatoVar(object):
def __init__(self):
self.data = None
def write(self, data):
self.data = data
def get(self):
return self.data
and then:
pick = PickleDatatoVar()
pickle.dump(Int, pick)
var = pick.get()
Nothing is presented as error, but the output is just a '.'
So is there a solution to instead of saving that in a file saving into a variable?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…