Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

How do I find the full path of the currently running Python interpreter from within the currently executing Python script?

1 Answer

0 votes
by (106k points)

For finding the full path of the Python interpreter you can use sys.executable which contains the full path of the currently running Python interpreter. Below is the code that shows how to use the sys.executable and get the full path in Python.

import sys

print(sys.executable)

image

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...