Robin
I added the global statement just after the "import string" statement, but I
still get the same error. Interestingly, if I remove the line:
PipeGridData = NewGridData
I do not get an error on the line:
NewGridData =
PipeGridData[0:DelRow-1]+PipeGridData[DelRow:len(PipeGridData)]
This was also the case before I inserted the global statement. It seems to
allow the creation of NewGridData (without the global statement) but the
trouble comes when assigning it to the original PipeGridData.
Any more thoughts?
Lynndon
···
-----Original Message-----
From: Robin Dunn [SMTP:robin@alldunn.com]
Sent: Thursday, 11 October 2001 10:30
To: wxpython-users@lists.wxwindows.org
Subject: Re: [wxPython] Grid Delete Row>
> I have modified my code to attempt to modify the underlying data, but I
get
> an UnboundLocalError : local variable 'PipeGridData' referenced before
> assignment at line 224. Any suggestions?
>Python 101.
Since PipeGridData is assigned to in the function, python assumes it is a
local variable and tries to optimize it. Since you really mean it to be a
global then you need to add the "global PipeGridData" statement before you
use it in the function.--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users