2017/6/23

安裝Python3

直接brew安裝
$ brew install python3

查看python版本確認安裝
$ python3 --version

安裝python3 也會幫你把pip3裝好
查看pip3版本
$pip3 --version

用pip3查看已經安裝的套件
$pip3 list

更新pip3
$ pip3 install -U pip

直接在終端機使用直譯器(⌃+d離開此模式)
➜ ~ python3
Python 3.6.1 (default, Apr 4 2017, 09:40:21)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello")
Hello
>>>

執行.py檔案,先到.py檔案的地方
➜ ~ cd Desktop
➜ Desktop ls
python測試.py
➜ Desktop python3 python測試.py
Xanxus

沒有留言:

張貼留言