Getting python.exe path at runtime

On Windows, how do I find the path to python.exe from a script at runtime?

+4
source share
1 answer
>>> import sys >>> sys.executable 'C:\\Program Files\\Python31\\pythonw.exe' 
+11
source

All Articles