Reputation: 1448
I have this pickled object which I want to open but the idle is returning the error
TypeError: file must have 'read' and 'readline' attributes
Here is my code
openPrimorial = ('Primorial_pickled.txt','rb')
primorial = pickle.load(openPrimorial)
openPrimorial.close()
What am I doing wrong?
Upvotes: 1
Views: 911
Reputation: 97178
You forgot to call the open() method. Your current code simply creates a tuple of two values; it doesn't open any file.
Upvotes: 4