XRC fits from the command line

Christian K ckkart at hoc.net
Thu May 3 16:30:35 PDT 2007


Mike Driscoll wrote:
> 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')

This looks for 'login.xrc' in the current dir...

> 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

... and here you seem to want to be able to start the script from any location
so that in the end 'login.xrc' is not in the current dir.

I use something like the following to find the location of the xrc file:

xrcfile = os.path.splitext(os.path.abspath(__file__))[0]+'.xrc'

Christian





More information about the wxpython-users mailing list