problem with pickle

Lawrence Oluyede raims at dot.com
Sat Jul 7 13:58:53 EDT 2007


K Gaur <gaurkuber at gmail.com> wrote:
> 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



More information about the Python-list mailing list