[Tutor] Local Unbound Mystery

Kent Johnson kent37 at tds.net
Fri Sep 19 22:26:07 CEST 2008


On Fri, Sep 19, 2008 at 3:51 PM, Wayne Watson
<sierra_mtnview at sbcglobal.net> wrote:
> In some code I'm writing, I ran into a problem with the variable updown. I
> want it to be global. I cut down the code to near the essentials. I set a
> variable abc, and it seems to be happy with an almost identical use of
> updown. Where's this going wrong? Although there's an implication of a
> yyyy/mm/dd date, I omitted any check, so just enter a number.

You don't seem to have posted the actual code you used to generate the
traceback - there is no 'print updown' in sync_high2low_files().
Anyway this probably explains your problem:

http://effbot.org/pyfaq/how-do-you-set-a-global-variable-in-a-function.htm

Kent


More information about the Tutor mailing list