pyenv - How to tell, from within a running script, what Python interpreter is running it? -
this question has answer here:
- find full path of python interpreter? 5 answers
i output, in script, full path of python interpreter running it:
#!/usr/bin/env python print("{}".format(full_path_of_interpreter_running_this_script)
the script in path
, run as:
script.py
can that? how?
note: doing which python
or type python
in bash
not me, because using pyenv
, , pyenv
doing shims magic.
note: more identifying python executable, interested in identifying virtualenv being used, , thought knowing full path interpreter me in this.
this gives full path command used run script:
import sys print(sys.executable)
Comments
Post a Comment