How to check installation path of python

Sometimes, we need check the installation of python application, we can use sys.executable.

sys.executable

return the path of python.exe by a string

How to get the installation path of python

You can use code bellow:

>>> import sys
>>> sys.executable
'C:\\Program Files\\Anaconda2\\python.exe'