On 24/04/2014 10:41, Alan Gauld wrote:
On 24/04/14 00:14, Martin wrote:
If I run from a command prompt, however, I get
C:\Users\Martin\Documents\College\python>python pickle.py
You have called your file pickle.py.
So when you try to import pickle the interpreter sees your file first
and im
On 24/04/14 00:14, Martin wrote:
If I run from a command prompt, however, I get
C:\Users\Martin\Documents\College\python>python pickle.py
You have called your file pickle.py.
So when you try to import pickle the interpreter sees your file first
and imports that not the library pickle.
Neve
Experimenting with pickling...
import pickle
file1 = open('first.txt','r')
contents = file1.read()
file1.close()
print(contents)
file2 = open('pickle.dat','wb')
pickle.dump(contents,file2,True)
file2.close()
contents = ''
file3 = open('pickle.dat','rb')
contents = pickle.load(file3)
print(co