471,330 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

problem with pickle

hello everybody
I've just started learning python . i stumbled upon this broad
spectrum function 'pickle'

but it is not getting executed as it should

this is what the python interpreter returns on giving the basic
command
>>>pickle.dump(x,f) where x is a tuple and f is a file object
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'pickle' is not defined

kindly elucidate what's wrong

thanks

Jul 7 '07 #1
1 8212
K Gaur <ga*******@gmail.comwrote:
this is what the python interpreter returns on giving the basic
command
>>pickle.dump(x,f) where x is a tuple and f is a file object

Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'pickle' is not defined

kindly elucidate what's wrong

You should import the module in the local namespace before using it:
>>import pickle
pickle.dump
--
Lawrence, oluyede.org - neropercaso.it
"It is difficult to get a man to understand
something when his salary depends on not
understanding it" - Upton Sinclair
Jul 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mark Hahn | last post: by
1 post views Thread by Jesse Bloom | last post: by
6 posts views Thread by Jim Lewis | last post: by
2 posts views Thread by Mario Ceresa | last post: by
reply views Thread by Irmen de Jong | last post: by
2 posts views Thread by Danny Shevitz | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.