python初学者的建议
今天心血来潮想学python,php用的时间长了,感觉有点局限性,python安装真简单啊,一路next就行了,按照教程开始写第一个脚本,在命令台输入print "hello word"回车运行,竟然提示我Syntax Error,语法错误!难道教程有错?不可能啊,我又仔仔细细检查了一遍。没错。
后来上网查看知道原因了,我下的是最新的3.3.1版本,print已经是函数而不是语句了,是函数就必须加括号,改为print("hello world")。OK正常。而我看的教程是2.x的。现在2.x是主流包括市面的很多书籍及网上的教程。所以一定要瞅准版本。
看了Python3.x和Python2.x的区别 ,改动较大。不过3.x是趋势,作为新人我还是学较新的吧。
推荐不错Python学习资源
国内社区:http://woodpecker.org.cn/ 注意下面有豆瓣资助,好像豆瓣和python关系暧昧
深入 Python :Dive Into Python 中文版
[Python学习手册(第4版)].(Learning.Python).Mark.Lutz.扫描版
----------------------------------
查看著名的Python哲学语句
只需要执行一行代码
import this
以下是内容
The Zen of Python, by 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.
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!