python 编程中的英文术语不懂,请指教。
-
- 帖子: 1038
- 注册时间: 2007-01-10 9:32
python 编程中的英文术语不懂,请指教。
本人编程新手,很想学python。但是很多不懂。
6.6. Programming with style
Readability is very important to programmers, since in practice programs are read and modified far more often then they are written. But, like most rules, we occasionaly break them. Most of the code examples in this book will be consistent with the Python Enhancement Proposal 8 (PEP 8), a style guide developed by the Python community.
We’ll have more to say about style as our programs become more complex, but a few pointers will be helpful already:
use 4 spaces (instead of tabs) for indentation
limit line length to 78 characters
when naming identifiers, use CamelCase for classes (we’ll get to those) and lowercase_with_underscores for functons and variables
place imports at the top of the file
keep function definitions together
use docstrings to document functions
use two blank lines to separate function definitions from each other
keep top level statements, including function calls, together at the bottom of the program
红色不懂,请教。
6.6. Programming with style
Readability is very important to programmers, since in practice programs are read and modified far more often then they are written. But, like most rules, we occasionaly break them. Most of the code examples in this book will be consistent with the Python Enhancement Proposal 8 (PEP 8), a style guide developed by the Python community.
We’ll have more to say about style as our programs become more complex, but a few pointers will be helpful already:
use 4 spaces (instead of tabs) for indentation
limit line length to 78 characters
when naming identifiers, use CamelCase for classes (we’ll get to those) and lowercase_with_underscores for functons and variables
place imports at the top of the file
keep function definitions together
use docstrings to document functions
use two blank lines to separate function definitions from each other
keep top level statements, including function calls, together at the bottom of the program
红色不懂,请教。
- 枫叶饭团
- 帖子: 14683
- 注册时间: 2010-06-16 1:05
- 系统: Mac OS X
- 来自: Tencent
- 联系:
Re: python 编程中的英文术语不懂,请指教。
把import语句放在开头,用三引号变给函数写文档
- cuihao
- 帖子: 4793
- 注册时间: 2008-07-24 11:33
- 来自: 郑州
- 联系:
Re: python 编程中的英文术语不懂,请指教。
lz找个汉语教程不就ok了……
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 蓝红黄蓝绿红
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
-
- 帖子: 1038
- 注册时间: 2007-01-10 9:32
Re: python 编程中的英文术语不懂,请指教。
cuihao 写了:lz找个汉语教程不就ok了……
How to Think Like a Computer Scientist: Learning with Python 3
这个书没有汉语的。
不过我刚买了一本。《python 入门经典》。2012-8月出的,不知道怎么样。还没到货。
python 2 不想学。
- cuihao
- 帖子: 4793
- 注册时间: 2008-07-24 11:33
- 来自: 郑州
- 联系:
Re: python 编程中的英文术语不懂,请指教。
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 蓝红黄蓝绿红
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
- 枫叶饭团
- 帖子: 14683
- 注册时间: 2010-06-16 1:05
- 系统: Mac OS X
- 来自: Tencent
- 联系:
Re: python 编程中的英文术语不懂,请指教。
py2和3其实差别到是不大,学学也没事。。。别看中文,中文的就是乱扯,扯得你头晕眼花之后才告诉你,其实这TM很简单
- cuihao
- 帖子: 4793
- 注册时间: 2008-07-24 11:33
- 来自: 郑州
- 联系:
Re: python 编程中的英文术语不懂,请指教。
饭团让我这看一页英语就头疼的情何以堪。
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 蓝红黄蓝绿红
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
- aulara
- 帖子: 87
- 注册时间: 2013-01-05 16:29
- 系统: Precise
Re: python 编程中的英文术语不懂,请指教。
把导入语句放在页首只是看起来美观,现实中Django的开发者都喜欢行内导入
三引号可以为您的IDE提供api提示,还是很实用的
三引号可以为您的IDE提供api提示,还是很实用的
欢迎光临俺的ubuntu server小站:极光账本 aulara.cn
-
- 帖子: 1038
- 注册时间: 2007-01-10 9:32
Re: python 编程中的英文术语不懂,请指教。
这个很有意思,不过我想只是针对中文作者的书,而不是翻译过来的书。枫叶饭团 写了:py2和3其实差别到是不大,学学也没事。。。别看中文,中文的就是乱扯,扯得你头晕眼花之后才告诉你,其实这TM很简单
- luojie-dune
- 帖子: 22033
- 注册时间: 2007-07-30 18:28
- 系统: Linux
- 来自: 空气中
Re: python 编程中的英文术语不懂,请指教。
其实感觉不是翻译的缘故,而是中文写作的问题。。。。。drongh 写了:这个很有意思,不过我想只是针对中文作者的书,而不是翻译过来的书。枫叶饭团 写了:py2和3其实差别到是不大,学学也没事。。。别看中文,中文的就是乱扯,扯得你头晕眼花之后才告诉你,其实这TM很简单
- cuihao
- 帖子: 4793
- 注册时间: 2008-07-24 11:33
- 来自: 郑州
- 联系:
Re: python 编程中的英文术语不懂,请指教。
读了许多翻译的书…… 翻译水准都不敢恭维。drongh 写了:这个很有意思,不过我想只是针对中文作者的书,而不是翻译过来的书。枫叶饭团 写了:py2和3其实差别到是不大,学学也没事。。。别看中文,中文的就是乱扯,扯得你头晕眼花之后才告诉你,其实这TM很简单
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 蓝红黄蓝绿红
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
-
- 帖子: 1038
- 注册时间: 2007-01-10 9:32
Re: python 编程中的英文术语不懂,请指教。
晕,新买的书还是python2 的,想学python3,看来只有看英文的。
目前市面上基本没有python3的书。
目前市面上基本没有python3的书。
- yjcong
- 帖子: 2470
- 注册时间: 2006-02-28 3:11
Re: python 编程中的英文术语不懂,请指教。
看一页确实头痛, 但看一千页就不头痛了cuihao 写了: 饭团让我这看一页英语就头疼的情何以堪。
一梦三年,
松风依旧,
萝月何曾老.
灵幽听微, 谁观玉颜?
灼灼春华, 绿叶含丹.
松风依旧,
萝月何曾老.
灵幽听微, 谁观玉颜?
灼灼春华, 绿叶含丹.
-
- 帖子: 22323
- 注册时间: 2010-07-19 21:41
- 系统: OS X
- cuihao
- 帖子: 4793
- 注册时间: 2008-07-24 11:33
- 来自: 郑州
- 联系:
Re: python 编程中的英文术语不懂,请指教。
是翻译的人硬要用汉语套英语的问题。jtshs256 写了:是中文本身的问题
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 蓝红黄蓝绿红
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
Site: CUIHAO.TK Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~