Hot to get Python executable's path ??

Fredrik Lundh fredrik at pythonware.com
Sat Jun 14 06:14:54 EDT 2003


"vivek kumar" wrote:

>   I am writing a CGI app. I was trying to find out a way to change the #!
> line in the CGI scripts for different platforms using an install script.
> Like as I am developing it on windows so the line says
>
>          #!c:\python22\python.exe
>
> Now on linux it may be /usr/bin/python or /usr/local/bin/python and on
> windows also it may be anywhere the user has installed it.

    sys.executable

</F>








More information about the Python-list mailing list