XRC fits from the command line
Mike Driscoll
mdriscoll at co.marshall.ia.us
Fri May 4 06:58:11 PDT 2007
Christian,
Thanks for the tip. Unfortunately, my program's location is in a UNC path
and the app is run on windows, so when you double-click the cmd file, it
reverts to C:\Windows since it doesn't support UNC.
I got it to work by hard-coding the location of the xrc file though. I
just wish there was a better way. I was trying to avoid that.
Thanks again,
Mike
-----Original Message-----
From: Christian K [mailto:ckkart at hoc.net]
Sent: Thursday, May 03, 2007 6:31 PM
To: wxpython-users at lists.wxwidgets.org
Subject: Re: XRC fits from the command line
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