[Tutor] pickle problem

Roelof Wobben rwobben at hotmail.com
Tue Oct 12 19:35:09 CEST 2010



Hello, 
 
I have this code : 
 
import urllib
import pickle
 
image = urllib.URLopener()
image.retrieve("http://www.pythonchallenge.com/pc/def/peak.html","banner.p" )
plaatje = open("banner.p", "rb")
plaatje2 = pickle.load(plaatje)
 
But it gives this output :
 
Traceback (most recent call last):
  File "C:\Users\wobben\workspace\oefeningen\src\test2.py", line 7, in <module>
    plaatje2 = pickle.load(plaatje)
  File "C:\Python27\lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "C:\Python27\lib\pickle.py", line 858, in load
    dispatch[key](self)
KeyError: '<'

 
What does this mean ?
 
Roelof
  		 	   		  


More information about the Tutor mailing list