Use Pickle to save and read : Pickle : Database PYTHON examples


PYTHON examples » Database » Pickle »

 

Use Pickle to save and read


 

import pickle

dFile = open("storage.dat""wb")

x = 123.467
pickle.dumpx,dFile )
y = 10
pickle.dumpy,dFile )
z = "Hello""Goodbye" }
pickle.dumpz, dFile )

dFile.close()

iFile = open("storage.dat""rb" )

d1 = pickle.load(iFile)
print d1
d2 = pickle.load(iFile)
print d2
d3 = pickle.load(iFile)
print d3

iFile.close()
print "Done"

   
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Database
» Pickle