Skip to content

Commit 0301bb3

Browse files
committed
add files
0 parents  commit 0301bb3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+18804
-0
lines changed

Makefile

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = build
9+
10+
# Internal variables.
11+
PAPEROPT_a4 = -D latex_paper_size=a4
12+
PAPEROPT_letter = -D latex_paper_size=letter
13+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
14+
# the i18n builder cannot share the environment and doctrees with the others
15+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
16+
17+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
18+
19+
help:
20+
@echo "Please use \`make <target>' where <target> is one of"
21+
@echo " html to make standalone HTML files"
22+
@echo " dirhtml to make HTML files named index.html in directories"
23+
@echo " singlehtml to make a single large HTML file"
24+
@echo " pickle to make pickle files"
25+
@echo " json to make JSON files"
26+
@echo " htmlhelp to make HTML files and a HTML help project"
27+
@echo " qthelp to make HTML files and a qthelp project"
28+
@echo " devhelp to make HTML files and a Devhelp project"
29+
@echo " epub to make an epub"
30+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
31+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
32+
@echo " text to make text files"
33+
@echo " man to make manual pages"
34+
@echo " texinfo to make Texinfo files"
35+
@echo " info to make Texinfo files and run them through makeinfo"
36+
@echo " gettext to make PO message catalogs"
37+
@echo " changes to make an overview of all changed/added/deprecated items"
38+
@echo " linkcheck to check all external links for integrity"
39+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
40+
41+
clean:
42+
-rm -rf $(BUILDDIR)/*
43+
44+
html:
45+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
46+
@echo
47+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
48+
49+
dirhtml:
50+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
51+
@echo
52+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
53+
54+
singlehtml:
55+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
56+
@echo
57+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
58+
59+
pickle:
60+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
61+
@echo
62+
@echo "Build finished; now you can process the pickle files."
63+
64+
json:
65+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
66+
@echo
67+
@echo "Build finished; now you can process the JSON files."
68+
69+
htmlhelp:
70+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
71+
@echo
72+
@echo "Build finished; now you can run HTML Help Workshop with the" \
73+
".hhp project file in $(BUILDDIR)/htmlhelp."
74+
75+
qthelp:
76+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
77+
@echo
78+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
79+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
80+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Pythontutorial.qhcp"
81+
@echo "To view the help file:"
82+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Pythontutorial.qhc"
83+
84+
devhelp:
85+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
86+
@echo
87+
@echo "Build finished."
88+
@echo "To view the help file:"
89+
@echo "# mkdir -p $$HOME/.local/share/devhelp/Pythontutorial"
90+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Pythontutorial"
91+
@echo "# devhelp"
92+
93+
epub:
94+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
95+
@echo
96+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
97+
98+
latex:
99+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
100+
@echo
101+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
102+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
103+
"(use \`make latexpdf' here to do that automatically)."
104+
105+
latexpdf:
106+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
107+
@echo "Running LaTeX files through pdflatex..."
108+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
109+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
110+
111+
text:
112+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
113+
@echo
114+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
115+
116+
man:
117+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
118+
@echo
119+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
120+
121+
texinfo:
122+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
123+
@echo
124+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
125+
@echo "Run \`make' in that directory to run these through makeinfo" \
126+
"(use \`make info' here to do that automatically)."
127+
128+
info:
129+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
130+
@echo "Running Texinfo files through makeinfo..."
131+
make -C $(BUILDDIR)/texinfo info
132+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
133+
134+
gettext:
135+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
136+
@echo
137+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
138+
139+
changes:
140+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
141+
@echo
142+
@echo "The overview file is in $(BUILDDIR)/changes."
143+
144+
linkcheck:
145+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
146+
@echo
147+
@echo "Link check complete; look for any errors in the above output " \
148+
"or in $(BUILDDIR)/linkcheck/output.txt."
149+
150+
doctest:
151+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
152+
@echo "Testing of doctests in the sources finished, look at the " \
153+
"results in $(BUILDDIR)/doctest/output.txt."

build/doctrees/appetite.doctree

13.5 KB
Binary file not shown.

build/doctrees/classes.doctree

148 KB
Binary file not shown.

build/doctrees/controlflow.doctree

112 KB
Binary file not shown.

build/doctrees/datastructures.doctree

101 KB
Binary file not shown.

build/doctrees/environment.pickle

64.2 KB
Binary file not shown.

build/doctrees/errors.doctree

68.4 KB
Binary file not shown.

build/doctrees/floatingpoint.doctree

26.7 KB
Binary file not shown.

build/doctrees/index.doctree

13.6 KB
Binary file not shown.

build/doctrees/inputoutput.doctree

76.6 KB
Binary file not shown.

build/doctrees/interactive.doctree

30.1 KB
Binary file not shown.

build/doctrees/interpreter.doctree

56.7 KB
Binary file not shown.

build/doctrees/introduction.doctree

75.6 KB
Binary file not shown.

build/doctrees/modules.doctree

112 KB
Binary file not shown.

build/doctrees/stdlib.doctree

52.7 KB
Binary file not shown.

build/doctrees/stdlib2.doctree

58.3 KB
Binary file not shown.

build/doctrees/whatnow.doctree

16 KB
Binary file not shown.

build/pythontutorial3/.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 39e892fb4735113d1a74a8e0a6c62658
4+
tags: fbb0d17656682115ca4d033fb2f83ba1
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.. _tut-intro:
2+
3+
**********************
4+
开胃菜
5+
**********************
6+
7+
如果你要用计算机做很多工作,最后你会发现有一些任务你更希望用自动化的方式进行处理。 比如,你想要在大量的文本文件中执行查找/替换,或者以复杂的方式对大量的图片进行重命名和整理。 也许你想要编写一个小型的自定义数据库、一个特殊的GUI应用程式或一个简单的小游戏。
8+
9+
如果你是一名专业的软件开发者,可能你必须使用几种C/C++/JAVA类库,并且发现通常编写/编译/测试/重新编译的周期是如此漫长。 也许你正在为这些类库编写测试用例,但是发现这是一个让人烦躁的工作。 又或者你已经完成了一个可以使用扩展语言的程式,但你并不想为此重新设计并实现一套全新的语言。
10+
11+
那么Python正是你所需要的语言。
12+
13+
虽然你能够通过编写Unix shell脚本或Windows批处理文件来处理其中的某些任务,但Shell脚本更适合移动文件或修改文本数据,并不适合编写GUI应用程序或游戏; 虽然你能够使用C/C++/JAVA编写程序,但即使编写一个简单的 first-draft 程序也有可能耗费大量的开发时间。 相比之下,Python更易于使用,无论在Windows、Mac OS X或Unix操作系统上它都会帮助你更快的完成任务。
14+
15+
虽然Python易于使用,但它却是一门完整的编程语言;与Shell脚本或批处理文件相比,它为编写大型程序提供了更多的结构和支持。 另一方面,Python提供了比C更多的错误检查,并且作为一门 * 高级语言* ,它内置支持高级的数据结构类型,例如:灵活的数组和字典。 因其更多的通用数据类型,Python比Awk甚至Perl都适用于更的多问题领域,至少大多数事情在Python中与其他语言同样简单。
16+
17+
Python允许你将程序分割为不同的模块,以便在其他的Python程序中重用。 Python内置提供了大量的标准模块,你可以将其用作程序的基础,或者作为学习Python编程的示例。 这些模块提供了诸如文件I/O、系统调用、sockets支持,甚至类似Tk的用户图形界面(GUI)工具包接口。
18+
19+
Python是一门解释型语言,因为无需编译和链接,你可以在程式开发中节省宝贵的时间。 Python解释器可以交互的使用,这使得试验语言的特性、编写临时程序或在自底向上的程序开发中测试方法非常容易。 你甚至还可以把它当做一个桌面计算器。
20+
21+
Python让程序编写的紧凑和可读。 用Python编写的程式通常比同样的C、C++或Java程式更短小,这是因为以下几个原因:
22+
23+
* 高级数据结构使你可以在一条语句中表达复杂的操作;
24+
25+
* 语句组使用缩进代替开始和结束大括号来组织;
26+
27+
* 变量或参数无需声明。
28+
29+
Python是 *可扩展* 的:如果你会C语言编程便可以轻易的为解释器添加内置函数或模块,或者为了对性能瓶颈作优化,或者将Python程序与只有二进制形式的库(比如某个专业的商业图形库)连接起来。 一旦你真正掌握了它,你可以将Python解释器集成进某个C应用程序,并把它当做那个程序的扩展或命令行语言。
30+
31+
顺便说一句,这个语言的名字来自于BBC的“Monty Python’s Flying Cirecus”节目,和爬行类动物没有任何关系。 在文档中引用Monty Python的典故不仅可行,而且值得鼓励!
32+
33+
现在你已经为Python兴奋不已了吧,大概想要领略一些更多的细节! 学习一门语言最好的方法就是使用它,本指南推荐你边读边使用Python解释器练习。
34+
35+
下一节中,我们将解释Python解释器的用法。 这是很简单的一件事情,但它有助于试验后面的例子。
36+
37+
本手册剩下的部分将通过示例介绍Python语言及系统的诸多特性,开始是简单的语法、数据类型和表达式,接着介绍函数与模块,最后涉及异常和自定义类这样的高级内容。

0 commit comments

Comments
 (0)