Help with new scope problem

Carel Fellinger cfelling at iae.nl
Mon Mar 19 04:08:12 CET 2001


Luis Cortes <lcortes at aodinc.com> wrote:
> Hello,

> I have a piece of code that I think should work fine, but I believe that
> I've hit a scope problem (Python 2.1b1).  Does anyone out there have a hint
> as to how to fix it??

> code:
...sniped

if I use the exact same code, and add a call to getarguments it seems to
work here, but...

> def getarguments():
...
>         print box, gifname, newgifname

Surely *this* print statement gave the expected outcome?
It does here.

>         sys.exit(0)
>         return ( box, gifname, newgifname )

> THE PROBLEM:  when I have more than 3 arguments, the global variables do not
> change to the correct variables, but instead print their default values.


-- 
groetjes, carel



More information about the Python-list mailing list