[wxPython-users] Re: two questions about XRC

Robin Dunn robin at alldunn.com
Mon Oct 2 12:31:32 PDT 2006


John Salerno wrote:
> Robin Dunn wrote:
> 
>>> I get an error that the module has no attribute 'xrc'
>>
>> Did you import both wx and wx.xrc, or just wx?
> 
> No, just wx. That's what I meant when I said that calling 
> wx.xrc.XmlResource() didn't work, but Josiah said it worked for him. I'm 
> guessing we are talking about two different things.

Nope, you left out a step that Josiah showed you.  You are doing 
something like this:

  >>> import wx
  >>> wx.xrc.XmlResource
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  AttributeError: 'module' object has no attribute 'xrc'
  >>>

Josiah showed you this (more or less):

  >>> import wx
  >>> import wx.xrc
  >>> wx.xrc.XmlResource
  <class 'wx.xrc.XmlResource'>
  >>>

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list