← Go Back

How to Get Full Path of the Interpreter

The sys standard module defines the executable string with the full path of the interpreter that is executing the current code. For example, on Windows:

>>> import sys
>>> sys.executable
'C:\\Python312\\python.exe'

On Linux:

>>> import sys
>>> sys.executable
'/usr/bin/python3'


sys interpreter


🐍 You might also find interesting: