Re: [Tutor] some things work in IDLE but not a command prompt and vice versa

2014-04-25 Thread Martin
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

Re: [Tutor] some things work in IDLE but not a command prompt and vice versa

2014-04-24 Thread Alan Gauld
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

[Tutor] some things work in IDLE but not a command prompt and vice versa

2014-04-24 Thread Martin
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