XRC fits from the command line
Mike Driscoll
mdriscoll at co.marshall.ia.us
Fri May 4 07:05:55 PDT 2007
Christian,
I spoke too soon. I used your script like so:
xrcpath = os.path.splitext(sys.argv[0])[0]+'.xrc'
Not exactly readable, but it's works pretty well.
Thanks for the idea. Hopefully I will begin to think more and more in the
abstract as well.
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