其实就一行代码
macOS
自带 python
解释器,这里就不多说了,可以通过下面命令进行测试:
$ python --version
Python 2.7.10
安装 python3
没有 安装 homebrew
先安装 homebrew
啦
// 安装在 /usr/local/Cellar/python3
$ brew install python3
使用 python3
$ python3 test.py
升级与安装 python2
$ brew install python
使用 python2
$ python test.py