Skip to content

Instantly share code, notes, and snippets.

@bluethon
Created October 4, 2016 03:34
Show Gist options
  • Save bluethon/1b795f972eb5a6becf5d9274073e6e0f to your computer and use it in GitHub Desktop.
Save bluethon/1b795f972eb5a6becf5d9274073e6e0f to your computer and use it in GitHub Desktop.
python中获取解释器路径
# http://docs.python.org/library/sys.html
import sys
print(sys.executable)
@ChenghaoQ
Copy link

有没有其他方法?如果脚本内嵌在其他程序中,sys.executable会显示外部程序路径而不是解释器路径

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment