
Python 開發工具
寫程式的工具
利用 Python 官方直譯器可以在命命列打開互動式介面,基本上只要在命令列打指令 python 或 python3 就可以進入,以下為用 Mac 終端機打開互動式介面

在 Mac 或 Linux 系統安裝 Python 同時會設定好命令列路徑,也就是在命令列可以直接用 Python 指令,如果是用 MS-Windows 系統,可能需要額外設定命令列路徑才可以在命令列使用 Python 指令。
Python 官方直譯器另外提供 IDLE ,這是視窗化的互動式介面,以下為 Mac 版本的 IDLE

在選單利用 File 裡面的 New File 可以新增副檔名為 .py 的 Python 檔案

這裡簡單示範打個 Hello 程式,檔案儲存為 hello.py

利用 Run 裡面的 Run Module 就可以執行 hello.py

執行結果會顯示在 Python Shell 的視窗

官方直譯器的互動式介面或 IDLE 對初學練習或測試都很方便,倒是真正打程式不外是回到用文字編輯器或整合開發環境,下圖為知名開放原始碼的文字編輯器 Atom 的 Mac 版本

以下為熱門開放原始碼的文字編輯器官網列表
名稱 | 網址 |
---|---|
Atom | https://atom.io/ |
GNU Emacs | https://www.gnu.org/software/emacs/ |
GNU nano | https://nano-editor.org/ |
Notepad++ | https://notepad-plus-plus.org/ |
Vim | https://www.vim.org/ |
文字編輯器的種類不勝枚舉,只要找到自己用起來順手的即可,整合開發環境同樣不勝枚舉,整合開發環境相較文字編輯器的好處是在整合開發環境就能顯示執行結果,不過很多整合開發環境可能需要另外設定 Python 直譯器的路徑,或是安裝外掛程式。
Atom 也可以當作 Python 輕量級的整合開發環境,需要額外安裝一些外掛程式。
大部分原生支援 Python 直譯器的整合開發環境都有特殊用途,例如用在資料科學方面
名稱 | 網址 |
---|---|
Jupyter | http://jupyter.org/ |
Rodeo | https://rodeo.yhat.com/ |
Spyder | https://github.com/spyder-ide/spyder |
其他如 PyCharm 雖也是原生支援 Python 直譯器,社群版可免費下載使用,倒是專業版要付費購買
名稱 | 網址 |
---|---|
PyCharm | https://www.jetbrains.com/pycharm/ |
