[Zope] local variable

Chris Withers chrisw@nipltd.com
Mon, 17 Mar 2003 10:57:58 +0000

D. Rick Anderson wrote:
> I've got a python script that sets a variable:
>     notes_eo_counter = 0 
> And then defines a function:
>     def printNotesRow(columns):

Defining functions within functions (which is what you're effectively doing 
here) is pretty ropey. Best to seperate printNotesRow out into a seperate method.

In the meantime, try declaring it like this:

      def printNotesRow(columns):
          global notes_eo_counter