Re: [Boa Constr] Boa app, full path to the running script ?
Status: Beta
Brought to you by:
riaan
From: Werner F. B. <wer...@fr...> - 2007-03-01 15:36:16
|
Hi, aus stuff wrote: > Hi, > Within my boa app i cant seem to get my running apps path directory. > > Using (within a frame/class) > self.staticText1.SetLabel(os.path.split(sys.argv[0])[0]) > returns relative dir path (can i get absolute?) > > sys.argv[0] > will return the scripts name but not its directory path (from root of > drive , on windows) > > Any other way to get the full path to your running app in boa apps on > windows? Quote from Riaan on this some time ago: mando wrote: > > os.getcwd() it's allright! > > > > My ultimate question is: why the method os.getcwd() run correctly with > > every IDE but this: directory, filename = os.path.split(sys.argv[0]) on Boa > > don't work? It's only a philosophic question!!!! Apologize me! When Boa runs python scripts out of process, it changes to the directory of the script and therefore only specifies the script name on the command line generated to run the script. I think this should work for all cases: directory, filename = os.path.split(os.path.abspath(sys.argv[0])) Best regards Werner |