/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import pickle zoit = { "Crud": "No", "Fsck": "Blox"} file = open("pickle.pck", "w") # write mode pickle.dump(zoit, file) print "Written to disk. Deleting 'zoit' now." del zoit file.close() del file print "Zoit is now deleted. Reading back from file now:" file = open("pickle.pck", "r") # read mode narf = pickle.load(file) print narf