image.png
#!/usr/local/bin/python3
# -*- coding:utf-8 -*-
import sys
print (sys.version)
上述代碼即可查看運行時的python3版本
第一行
#!/usr/local/bin/python3
指定python3路徑,這個路徑可以通過命令行中的which python3
來獲得
image.png
第二行是指解釋器通過
utf-8
字符集來讀
最后注意一下
python3
的
image.png