Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19288 > unrolled thread
| Started by | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| First post | 2012-01-23 14:21 -0700 |
| Last post | 2012-01-23 14:21 -0700 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Using an object inside a class Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-23 14:21 -0700
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2012-01-23 14:21 -0700 |
| Subject | Re: Using an object inside a class |
| Message-ID | <mailman.4985.1327353746.27778.python-list@python.org> |
On Mon, Jan 23, 2012 at 1:58 PM, MRAB <python@mrabarnett.plus.com> wrote: >> Either way would work but the main issue is I can't seem to use foo or >> foo.bar or foo.bar.object anywhere in __init__ or even before that in >> the main class area. >> > This line: > > foo = MyApp(0) > > will create a 'MyApp' instance and then bind it to the name 'foo'. > Until that binding occurs, the name 'foo' doesn't exist. What MRAB said; also note that there is no need to bind your wx.App instance to a name at all, because you can retrieve it globally by calling wx.GetApp(). Cheers, Ian
Back to top | Article view | comp.lang.python
csiph-web