pyenv - How to tell, from within a running script, what Python interpreter is running it? -


this question has answer here:

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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -