From: <mi...@pc...> - 2005-05-24 13:16:48
|
Quoting J=C3=BCrgen Kareta <py...@ka...>: > Hello, > > just a matter of interest. > > Today I changed some code wich I have written under python2.3 and ex'ed > with installer and py2exe. > Now I ex'ed them with py2exe0.5.4 (python2.4.1). In this code I > substract the path of the programm from > sys.argv[0]. That works fine in the past. But after ex'ing with > py2exe0.5.4 to a console programm sys.argv[0] > helds only the name of the programm and no path. > The wiki (py2exeEnvironment) tells: > 'The first item in sys.argv is the full pathname of the executable, the > rest are the command line arguments.' > > Is that a known change ? Can you verify this behaviour ? > It is likely that it contains the path relative to the current directory. If you are running it *from* the current directory then the full (relative) path, *is* just the filename. To get the absolute path, try ``full_path =3D os.path.abspath(sys.argv[0])`= ` I hope that helps. Regards, Fuzzy http://www.voidspace.org.uk/python > regards, > J=C3=BCrgen > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=3D7412&alloc_id=3D16344&op=3Dclick > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users > |