what's the difference between these two methods? (aka, why doesn't one of them work?)

Carsten Haese carsten at uniqsys.com
Thu Nov 2 21:46:20 CET 2006


On Thu, 2006-11-02 at 12:28 -0800, JohnJSal wrote:
> Can someone explain to me why the first version of this method works,
> but the second one doesn't? All I've changed (I think) is how the
> information is nested. The error I'm getting is that the call to
> xrc.XRCCTRL is not working in the second example. Instead of getting
> the appropriate widget, it's returning None. Is this a result of the
> nesting, or the for loops perhaps?
> [...]
> Traceback (most recent call last):
>   File "C:\Python25\myscripts\labdb\dbapp.py", line 91, in OnSaveRecord
>     table_values.append(xrc.XRCCTRL(tab, textfield_id).GetValue())
> AttributeError: 'NoneType' object has no attribute 'GetValue'
> 

You might find it helpful to inspect (e.g. print) textfield_id before
the line that causes the exception.

-Carsten





More information about the Python-list mailing list