第一章 Introduction
臉書討論區: https://www.facebook.com/groups/181524949124084
組隊報名表: (1~3人一隊)
The Zen of Python
這就是著名的《Python之禪》。
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. 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!
是谁創造了Python,我们一定要感恩並崇拜 !
Python的歷史
Python的創始人為吉多·範羅蘇姆(Guido van Rossum)。
關於這個人開發這種語言的過程,很多資料裏面都要記錄下面的故事:
1989年的聖誕節期間,吉多·範羅蘇姆為了在阿姆斯特丹打發時間,決心開發一個新的腳本解釋程序,作為ABC語言的一種繼承。之所以選中Python作為程序的名字,是因為他是一個蒙提·派森的飛行馬戲團的愛好者。ABC是由吉多參加設計的一種教學語言。就吉多本人看來,ABC這種語言非常優美和強大,是專門為非專業程序員設計的。但是ABC語言並沒有成功,究其原因,吉多認為是非開放造成的。吉多決心在Python中避免這一錯誤,並取得了非常好的效果,完美結合了C和其他一些語言。 這個故事我是從維基百科裏面直接覆制過來的,很多講Python歷史的資料裏面,也都轉載這段。但是,在我來看,這段故事有點忽悠人的味道。其實,上面這段中提到的,吉多為了打發時間而決定開發Python的說法,來自他自己的這樣一段自述:
Over six years ago, in December 1989, I was looking for a "hobby" programming project that would keep me occupied during the week around Christmas. My office (a government-run research lab in Amsterdam) would be closed, but I had a home computer, and not much else on my hands. I decided to write an interpreter for the new scripting language I had been thinking about lately: a descendant of ABC that would appeal to Unix/C hackers. I chose Python as a working title for the project, being in a slightly irreverent mood (and a big fan of Monty Python's Flying Circus).(原文地址:https://www.python.org/doc/essays/foreword/)
首先,必須承認,這個Guido是一個大神,非常傳奇的人。此處獻上我的崇拜。