[wxPython-users] XRC fits from the command line

Mike Driscoll mdriscoll at co.marshall.ia.us
Thu May 3 08:38:25 PDT 2007


Mr. Dunn,

I have the xrc file in the same directory as the python file that loads
it. So I use the following to load it: 

self.res = xrc.XmlResource('login.xrc')

The .cmd file that I am using calls the file by executing the following
command:

%PYTHONHOME%\python.exe
%NLPath%\PythonPackages\Development\Timesheet\backup\login_XRC.py

Where %PYTHONHOME% points to the path that holds the python executable and
where %NLPath% points to the path that the python file is.

I use this call all the time for other GUI's I've created that don't use
the XRC method yet. I am hoping to re-write some of that code to use it as
I like the ease of use of XRC.

Hopefully this will give you the information you need. 

Mike

-----Original Message-----
From: Robin Dunn [mailto:robin at alldunn.com] 
Sent: Wednesday, May 02, 2007 3:55 PM
To: wxPython-users at lists.wxwidgets.org
Subject: Re: [wxPython-users] XRC fits from the command line

Mike Driscoll wrote:
> Hi,
> 
> I am having a weird issue with XRC in my wxPython app. I am using 
> Python 2.4, wxPython 2.8 on Windows XP. I can run it fine by 
> double-clicking the file and from just running the file from within 
> IDLE. However, if I run it from the command line, the application 
> locks up and if I run it from a batch file, I get the following
traceback:
> 

[...]

> , line 249, in XRCCTRL
>     return window.FindWindowById(XRCID(str_id))
> AttributeError: 'NoneType' object has no attribute 'FindWindowById'

I expect that it is failing to load the xrc data.  How are you doing that?
Is a full pathname used?  Or is it assuming that the xrc file is in the
current directory but your current directory is somewhere else?

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






More information about the wxpython-users mailing list