Anaconda

Anaconda指的是一個開源的Python發行版本,其包含了conda、Python等180多個科學包及其依賴項。因為包含了大量的科學包,Anaconda 的下載檔案比較大,如果只需要某些包,或者需要節省頻寬或儲存空間,也可以使用Miniconda這個較小的發行版(僅包含conda和 Python)。

Anaconda該怎麼發音?

美式發音:a·nuh·kaan·duh
英式發音:a·nuh·kon·duh
優點:

省時:一鍵安裝完90%一般人這一輩子會用到的Python套件,剩下的再用pip install個別去安裝即可

缺點:

占空間:包含了一堆用不到的Python的套件(可安裝另一種miniconda)

下載與安裝

Anaconda下載

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

圖1.2.3-00

挑選你需要的作業系統版本即可。

更新spyder

# conda update spyder

注意:不要用pip或其他方式更新spyder,那有可能會損壞spyder


執行第一個Python程式

Hello, World!

print('Hello, World!')

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

圖1.1-02

按下鍵盤上的「F5」或是點選IDE上的綠色三角形按鈕可以執行程式。

編輯器說明

編輯區

程式碼都在這裡撰寫與編輯

執行結果

程式執行結果或是錯誤都會顯示在這個地方

輔助視窗

提供額外方便的功能,如:文件說明、變數清單、檔案總管等等。

好用快捷鍵

快捷鍵 描述
Ctrl+R 取代
Ctrl+1 單行註解,第一次註解,再次取消
Ctrl+4 區塊註解,第一次註解,再次取消
F5 執行程式
Ctrl+P 檔案切換
Ctrl+L 清空終端視窗
Ctrl+I 查看某個函式的說明文件
Ctrl+Shift+V 開啟變數視窗
Ctrl+Home 回到檔案開頭
Ctrl+End 跳到檔案結尾

從命令列執行

python HelloWorld.py