脚本编程与交互式编程
命令式

可以直接用 python 命令运行
➜ ~ python3 /media/terwer/data/workspace/terwer/pyhello/main.py
Hello World!
hello my friends
...小于 1 分钟
命令式

可以直接用 python 命令运行
➜ ~ python3 /media/terwer/data/workspace/terwer/pyhello/main.py
Hello World!
hello my friends
Mac 和 Linux 自带 Python ,不用额外配置,开箱即用。需要注意的是 Python 分为两个主要大版本, Python2 和 Python3 。现在推荐实用的是 Python3 ,不过有很多优秀类库是用 Python2 写的。
➜ ~ python -V
Python 2.7.16
当Mac升级到macOS Monterey 12.3之后,你会发现 python2 不见了,输入 python 也提示 找不到
➜ ~ python -m pip install --user virtualenv
zsh: command not found: python