← Go Back
On Linux:
How to Get Full Path of the Interpreter
Thesys
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'
🐍 You might also find interesting: