cPickling and variable scope problem

Martin v. Löwis martin at v.loewis.de
Mon Mar 17 01:36:17 EST 2003


Cere Davis <cere at u.washington.edu> writes:

> def unstash():
>     inf=open("stuff",'rb')
>     data=cPickle.load(inf)
>     inf.close()
[...]
> But I don't get any output for the data.keys() or data.values() from
> "main".  Can someone tell me what's wrong here?
> Perhaps obvious, but I am not seeing the problem.....

You should declare data global here as well.

Regards,
Martin




More information about the Python-list mailing list