[wxPython-users] RE: XRC fits from the command line

Robin Dunn robin at alldunn.com
Fri May 4 09:47:41 PDT 2007


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