python環境準備(後有彩蛋)

1.下載python安裝包

在官網 https://www.python.org/,根據系統版本下載Python安裝包,這裏我選擇下載:Python 3.7.6。
在這裏插入圖片描述

但是下載過程非常曲折,各種中斷。
於是選擇下載anaconda。anaconda本身就自帶了Python的解釋器而且還自帶了很多實用性工具。推薦清華源的下載地址:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
進入後選擇Anaconda3,3的意思就是Python3以上的版本,如果是anaconda2則就是python2。這裏我選擇更新時間最新的版本。

在這裏插入圖片描述
2.安裝
在這裏插入圖片描述

選擇爲所用用戶安裝或只是爲自己安裝。(直接下一步過去就行)
在這裏插入圖片描述
選擇安裝路徑

在這裏插入圖片描述
這裏建議將第一個勾選(將Anaconda添加到環境變量中,不勾選的話後期要自己添加到環境變量)

在這裏插入圖片描述
開始安裝
在這裏插入圖片描述

安裝完成

在這裏插入圖片描述
Anaconda文檔 https://docs.anaconda.com/anaconda/packages/
3.測試安裝
使用Win+R組合鍵,輸入cmd打開命令提示符窗口,再輸入python進入交互式終端。

在這裏插入圖片描述
4.彩蛋:《Python之禪》
在這裏插入圖片描述

The Zen of Python, by Tim Peters

《Python之禪》 Tim Peters

Beautiful is better than ugly.

優美勝於醜陋

Explicit is better than implicit.

明瞭勝於隱晦

Simple is better than complex.

簡潔勝於複雜

Complex is better than complicated.

複雜勝於混亂

Flat is better than nested.

扁平勝於嵌套

Sparse is better than dense.

寬鬆勝於緊湊

Readability counts.

可讀性很重要

Special cases aren’t special enough to break the rules.

即便是特例,也不可違背這些規則

Although practicality beats purity.

雖然現實往往不那麼完美

Errors should never pass silently.

但也不應該放過任何異常

Unless explicitly silenced.

除非你確定需要如此

In the face of ambiguity, refuse the temptation to guess.

如果存在多種可能性,不要猜測

There should be one-- and preferably only one --obvious way to do it.

肯定有一種–通常也是唯一一種–最佳的解決方案

Although that way may not be obvious at first unless you’re Dutch.

雖然這並不容易,因爲你不是Python之父

Now is better than never.

動手比不動手要好

Although never is often better than right now.

但不假思索就動手還不如不做

If the implementation is hard to explain, it’s a bad idea.

如果你的方案很難懂,那肯定不是一個好方案

If the implementation is easy to explain, it may be a good idea.

如果你的方案很好懂,那肯定是一個好方案

Namespaces are one honking great idea – let’s do more of those!

命名空間非常有用,我們應該多加利用

喜歡本文的朋友,歡迎關注公衆號 栗子程序員,收看更多精彩內容

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章