When I generate code from wxGlade for my application, I get the attached
scUI.py file. However, when I try to run the file (python scUI.py) I see this
error message:
File "scUI.py", line 132, in __init__
self.grid_1 = wx.grid.Grid(self.notebook_1_pane_2, -1, size=(1, 1))
AttributeError: 'module' object has no attribute 'grid'
The wxWidgets class description doesn't tell me what's wrong. Since this is
my first attempt to use a grid widget I cannot see the error. Please point it
out to me.
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
On Tue, 2005-08-16 at 18:14 -0700, Rich Shepard wrote:
When I generate code from wxGlade for my application, I get the attached
scUI.py file. However, when I try to run the file (python scUI.py) I see this
error message:
File "scUI.py", line 132, in __init__
self.grid_1 = wx.grid.Grid(self.notebook_1_pane_2, -1, size=(1, 1))
AttributeError: 'module' object has no attribute 'grid'
The wxWidgets class description doesn't tell me what's wrong. Since this is
my first attempt to use a grid widget I cannot see the error. Please point it
out to me.
Hmmm-m-m. Why doesn't 'import wx' import everything? I thought this was
equivalent to 'from wxPython import *'.
Many thanks,
Rich
···
On Wed, 17 Aug 2005, Ricardo Pedroso wrote:
It's missing a:
import wx.grid
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
... and it's in a different namespace, like the HtmlWindow (in wx.html)
because they are more complex controls and we don't need them every
time, avoiding unnecessary load/memory overhead.
At least I think it's the reason for this, someone correct me if I am
wrong.
Ricardo
···
On Wed, 2005-08-17 at 12:42 +1000, Horst Herb wrote:
On Wed, 17 Aug 2005 12:37, Rich Shepard wrote:
> Hmmm-m-m. Why doesn't 'import wx' import everything? I thought this was
> equivalent to 'from wxPython import *'
"import wx" imports all modules in the "wx." namespace, but not other
namespaces - "wx.grid" is a separate namespace.
That's good to know. Where do I find a list of all namespaces? I don't find
such a list in the docs I downloaded.
Thanks very much,
Rich
···
On Wed, 17 Aug 2005, Horst Herb wrote:
"import wx" imports all modules in the "wx." namespace, but not other
namespaces - "wx.grid" is a separate namespace.
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863