[wxPython-users] RE: XRC fits from the command line
Mike Driscoll
mdriscoll at co.marshall.ia.us
Fri May 4 11:45:12 PDT 2007
Thanks for your help, guys. Sorry I ask so many ignorant questions. I hope
that at some point I too can be a guru.
Have a great weekend!
Mike
-----Original Message-----
From: Robin Dunn [mailto:robin at alldunn.com]
Sent: Friday, May 04, 2007 11:48 AM
To: wxPython-users at lists.wxwidgets.org
Subject: Re: [wxPython-users] RE: XRC fits from the command line
Mike Driscoll wrote:
> 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.
You're already hard coding the application path in the cmd script, so
another approach to take is to set it in an environment variable instead
and then use it both in the script and in your Python.
set APP_PATH=%NLPath%\PythonPackages\Development\Timesheet\backup
%PYTHONHOME%\python.exe %APP_PATH%\login_XRC.py
Then in your Python code do something like this:
xrcpath = os.path.join(os.environ['APP_PATH'], 'login.xrc')
self.res = xrc.XmlResource(xrcpath)
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list