Hot to get Python executable's path ??

vivek kumar gupt_vive at
Sat Jun 14 11:38:41 CEST 2003

Hi all,

  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


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. So is there any 
way to find out the path for that. I tried


with "exec_prefix" and "prefix". But on linux it showed me /usr only ? So is 
there any way to find the path for the Installed Python executable to 
substitute it in my CGI scripts?

TIA and Kind Regards
Vivek Kumar

Dress up your desktop! Get the best wallpapers. Just 
click here!

More information about the Python-list mailing list