Hi Le Dahut,
I use the following code for prgrams built with py2exe:
import sys
import os
print os.path.dirname(sys.executable)
This may work in your situation as well.
Regards,
Andre
http://www.burgaud.com/
On 10/21/05, le dahut <[EMAIL PROTECTED]> wrote:
In fact I build an SFX archive wit
In fact I build an SFX archive with winrar where I specify a program to
launch once extraction has ended. The program is launched but don't find
it's sub-directory.
If I go to the extracted archive directory an dlbe-clic on "install.exe"
all runs fine, but whit winrar's "Run after extraction" optio
[le dahut]
> I try to get the program's directory, the one where the .exe (or .py)
is.
>From within Python, sys.argv[0] usually gives you the running
program (not sure what it does with py2exe etc.). So something
like (untested):
import os, sys
print os.path.dirname (sys.argv[0])
> With os.
hi
I try to get the program's directory, the one where the .exe (or .py)
is.
With os.getcwd() I get the directory from where the program is launched
not his directory. The program has to copy some files and thus I get an
error like "XX no such file or directory" (the DOS box closed to
quickly