├── .gitignore ├── Art ├── EditPlus1.png ├── EditPlus2.png ├── EditPlus3.png └── EditPlus4.png ├── LICENSE ├── PDT ├── EditPlus.zip └── EditPlus使用技巧.md ├── PythonCode ├── Python入门 │ ├── Dict │ │ ├── dict.py │ │ ├── dict的特点.py │ │ ├── 更新dict.py │ │ ├── 访问dict.py │ │ └── 遍历dict.py │ ├── List │ │ ├── List删除元素.py │ │ ├── List替换元素.py │ │ ├── List添加新元素.py │ │ ├── 倒叙访问List.py │ │ ├── 创建List.py │ │ └── 按照索引访问List.py │ ├── Python基本数据类型 │ │ ├── Unicode字符串.py │ │ ├── hello.py │ │ ├── print语句.py │ │ ├── raw字符串与多行字符串.py │ │ ├── 变量.py │ │ ├── 字符串.py │ │ ├── 布尔类型.py │ │ ├── 数据类型.py │ │ ├── 整数和浮点数.py │ │ └── 注释.py │ ├── Set │ │ ├── set基础.py │ │ ├── set特点.py │ │ ├── 更新set.py │ │ ├── 访问set.py │ │ └── 遍历set.py │ ├── Tuple │ │ ├── Tuple创建.py │ │ ├── 创建单元素Tuple.py │ │ └── 可变的Tuple.py │ ├── 函数 │ │ ├── 函数入门.py │ │ ├── 定义可变参数.py │ │ ├── 定义默认参数.py │ │ ├── 编写函数.py │ │ ├── 调用函数.py │ │ ├── 返回多值.py │ │ └── 递归函数.py │ ├── 切片 │ │ ├── 倒序切片.py │ │ ├── 字符串切片.py │ │ └── 对List进行切片.py │ ├── 列表生成器 │ │ ├── 复杂表达式.py │ │ ├── 多层表达式.py │ │ ├── 条件过滤.py │ │ └── 生成列表.py │ ├── 条件判断和循环 │ │ ├── break退出循环.py │ │ ├── continue继续循环.py │ │ ├── for循环.py │ │ ├── if-else.py │ │ ├── if-elseif-else.py │ │ ├── if语句.py │ │ ├── while循环.py │ │ └── 多重循环.py │ └── 迭代 │ │ ├── 索引迭代.py │ │ ├── 迭代.py │ │ ├── 迭代dict中的key和value.py │ │ └── 迭代dict中的value.py └── Python进阶 │ ├── 函数编程 │ ├── filter函数.py │ ├── map函数.py │ ├── reduce函数.py │ ├── 偏函数.py │ ├── 函数式编程简介.py │ ├── 匿名函数.py │ ├── 完善decorator.py │ ├── 带参decorator.py │ ├── 无参decorator.py │ ├── 自定义排序函数.py │ ├── 装饰器-decorator.py │ ├── 返回函数.py │ ├── 闭包.py │ └── 高阶函数.py │ ├── 定制类 │ ├── @property.py │ ├── __call__.py │ ├── __cmp__.py │ ├── __len__.py │ ├── __slots__限制属性.py │ ├── __str__和__repr__.py │ ├── 数学运算.py │ ├── 特殊方法.txt │ └── 类型转换.py │ ├── 模块 │ ├── 使用__future__.py │ ├── 动态导入模块.py │ ├── 导入模块.py │ ├── 导入第三方模块.txt │ └── 模块和包的概念.txt │ ├── 类的继承 │ ├── 判断类型.py │ ├── 多态.py │ ├── 多重继承.py │ ├── 类的继承.txt │ ├── 继承一个类.py │ └── 获取对象信息.py │ └── 面向对象基础 │ ├── 创建实例属性.py │ ├── 创建类属性.py │ ├── 初始化实例属性.py │ ├── 定义实例方法.py │ ├── 定义类并创建实例.py │ ├── 定义类方法.py │ ├── 方法也是属性.py │ ├── 类属性和实例属性名字冲突.py │ ├── 访问限制.py │ └── 面向对象.txt ├── PythonTools └── Tools │ ├── factorial.py │ ├── log.py │ └── performace.py └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | -------------------------------------------------------------------------------- /Art/EditPlus1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/Art/EditPlus1.png -------------------------------------------------------------------------------- /Art/EditPlus2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/Art/EditPlus2.png -------------------------------------------------------------------------------- /Art/EditPlus3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/Art/EditPlus3.png -------------------------------------------------------------------------------- /Art/EditPlus4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/Art/EditPlus4.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /PDT/EditPlus.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PDT/EditPlus.zip -------------------------------------------------------------------------------- /PDT/EditPlus使用技巧.md: -------------------------------------------------------------------------------- 1 | # EditPlus使用技巧: 2 | 3 | ## 工具组 4 | EditPlus支持自定义工具组,使用工具组可以帮助我们更加方便快速的开发。 5 | 6 | ### 1.工具 —> 自定义工具组 7 | ![edit1](https://github.com/GcsSloop/PythonNote/blob/master/Art/EditPlus1.png) 8 | ### 2.选择一个未定义工具组 9 | ![edit1](https://github.com/GcsSloop/PythonNote/blob/master/Art/EditPlus2.png) 10 | ### 3.配置工具组 11 | 添加工具 —> 程序, 然后按照以下方式进行配置。 12 | 13 | 其中命令那一行指向python安装路径下的python.exe 14 | ![edit1](https://github.com/GcsSloop/PythonNote/blob/master/Art/EditPlus3.png) 15 | 16 | ### 4.选择已经定义好的工具组 17 | 工具组前面有小点则表示已选中,选中的工具组中的工具列表会出现在工具最下面,在最后面有使用的快捷键,例如我的是ctrl+1,可以直接运行当前正在编辑的python文件。 18 | ![edit1](https://github.com/GcsSloop/PythonNote/blob/master/Art/EditPlus4.png) 19 | -------------------------------------------------------------------------------- /PythonCode/Python入门/Dict/dict.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | #author: sloop 3 | ''' 4 | 任务 5 | 新来的Paul同学成绩是 75 分,请编写一个dict,把Paul同学的成绩也加进去。 6 | 7 | d = { 8 | 'Adam': 95, 9 | 'Lisa': 85, 10 | 'Bart': 59 11 | } 12 | ''' 13 | 14 | d = { 15 | 'Adam': 95, 16 | 'Lisa': 85, 17 | 'Bart': 59, 18 | 'Paul': 75 19 | } 20 | print u'大小=',len(d) 21 | for k,v in d.iteritems(): 22 | print k,':',v 23 | 24 | ''' 25 | 什么是dict 26 | 我们已经知道,list 和 tuple 可以用来表示顺序集合,例如,班里同学的名字: 27 | 28 | ['Adam', 'Lisa', 'Bart'] 29 | 或者考试的成绩列表: 30 | 31 | [95, 85, 59] 32 | 但是,要根据名字找到对应的成绩,用两个 list 表示就不方便。 33 | 34 | 如果把名字和分数关联起来,组成类似的查找表: 35 | 36 | 'Adam' ==> 95 37 | 'Lisa' ==> 85 38 | 'Bart' ==> 59 39 | 给定一个名字,就可以直接查到分数。 40 | 41 | Python的 dict 就是专门干这件事的。用 dict 表示“名字”-“成绩”的查找表如下: 42 | 43 | d = { 44 | 'Adam': 95, 45 | 'Lisa': 85, 46 | 'Bart': 59 47 | } 48 | 我们把名字称为key,对应的成绩称为value,dict就是通过 key 来查找 value。 49 | 50 | 花括号 {} 表示这是一个dict,然后按照 key: value, 写出来即可。最后一个 key: value 的逗号可以省略。 51 | 52 | 由于dict也是集合,len() 函数可以计算任意集合的大小: 53 | 54 | >>> len(d) 55 | 3 56 | 注意: 一个 key-value 算一个,因此,dict大小为3。 57 | ''' -------------------------------------------------------------------------------- /PythonCode/Python入门/Dict/dict的特点.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Dict/dict的特点.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Dict/更新dict.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Dict/更新dict.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Dict/访问dict.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Dict/访问dict.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Dict/遍历dict.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | #author: sloop 3 | 4 | ''' 5 | 任务 6 | 请用 for 循环遍历如下的dict,打印出 name: score 来。 7 | 8 | d = { 9 | 'Adam': 95, 10 | 'Lisa': 85, 11 | 'Bart': 59 12 | } 13 | ''' 14 | 15 | #代码 16 | d = { 17 | 'Adam': 95, 18 | 'Lisa': 85, 19 | 'Bart': 59 20 | } 21 | 22 | print u'方式1--------------' 23 | for a in d: 24 | print a ,":",d[a] 25 | 26 | print u'方式2--------------' 27 | 28 | for key,value in zip(d.keys(),d.values()): 29 | print("%s:%s" %(key,value)) 30 | 31 | print u'方式3--------------' 32 | 33 | for k,v in d.items(): 34 | print k,':',v 35 | 36 | 37 | ''' 38 | 遍历dict 39 | 由于dict也是一个集合,所以,遍历dict和遍历list类似,都可以通过 for 循环实现。 40 | 41 | 直接使用for循环可以遍历 dict 的 key: 42 | 43 | >>> d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59 } 44 | >>> for key in d: 45 | ... print key 46 | ... 47 | Lisa 48 | Adam 49 | Bart 50 | 由于通过 key 可以获取对应的 value,因此,在循环体内,可以获取到value的值。 51 | ''' -------------------------------------------------------------------------------- /PythonCode/Python入门/List/List删除元素.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/List/List删除元素.py -------------------------------------------------------------------------------- /PythonCode/Python入门/List/List替换元素.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/List/List替换元素.py -------------------------------------------------------------------------------- /PythonCode/Python入门/List/List添加新元素.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/List/List添加新元素.py -------------------------------------------------------------------------------- /PythonCode/Python入门/List/倒叙访问List.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/List/倒叙访问List.py -------------------------------------------------------------------------------- /PythonCode/Python入门/List/创建List.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | ''' 3 | 任务 4 | 假设班里有3名同学:Adam,Lisa和Bart,他们的成绩分别是 95.5,85 和 59,请按照 名字, 分数, 名字, 分数... 的顺序按照分数从高到低用一个list表示,然后打印出来。 5 | ''' 6 | 7 | #代码; 8 | L = ['adam', 95.5, 'lisa', 85, 'bart', 59] 9 | print L 10 | 11 | ''' 12 | 创建list 13 | Python内置的一种数据类型是列表:list。list是一种有序的集合,可以随时添加和删除其中的元素。 14 | 15 | 比如,列出班里所有同学的名字,就可以用一个list表示: 16 | 17 | >>> ['Michael', 'Bob', 'Tracy'] 18 | ['Michael', 'Bob', 'Tracy'] 19 | list是数学意义上的有序集合,也就是说,list中的元素是按照顺序排列的。 20 | 21 | 构造list非常简单,按照上面的代码,直接用 [ ] 把list的所有元素都括起来,就是一个list对象。通常,我们会把list赋值给一个变量,这样,就可以通过变量来引用list: 22 | 23 | >>> classmates = ['Michael', 'Bob', 'Tracy'] 24 | >>> classmates # 打印classmates变量的内容 25 | ['Michael', 'Bob', 'Tracy'] 26 | 由于Python是动态语言,所以list中包含的元素并不要求都必须是同一种数据类型,我们完全可以在list中包含各种数据: 27 | 28 | >>> L = ['Michael', 100, True] 29 | 一个元素也没有的list,就是空list: 30 | 31 | >>> empty_list = [] 32 | ''' -------------------------------------------------------------------------------- /PythonCode/Python入门/List/按照索引访问List.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/List/按照索引访问List.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/Unicode字符串.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | 3 | ''' 4 | 任务 5 | 用多行Unicode字符串表示下面的唐诗并打印: 6 | 7 | 静夜思 8 | 9 | 床前明月光, 10 | 疑是地上霜。 11 | 举头望明月, 12 | 低头思故乡。 13 | ''' 14 | #代码 15 | print ur'''静夜思 16 | 17 | 床前明月光, 18 | 疑是地上霜。 19 | 举头望明月, 20 | 低头思故乡。''' 21 | 22 | """ 23 | Unicode字符串 24 | 字符串还有一个编码问题。 25 | 26 | 因为计算机只能处理数字,如果要处理文本,就必须先把文本转换为数字才能处理。最早的计算机在设计时采用8个比特(bit)作为一个字节(byte),所以,一个字节能表示的最大的整数就是255(二进制11111111=十进制255),0 - 255被用来表示大小写英文字母、数字和一些符号,这个编码表被称为ASCII编码,比如大写字母 A 的编码是65,小写字母 z 的编码是122。 27 | 28 | 如果要表示中文,显然一个字节是不够的,至少需要两个字节,而且还不能和ASCII编码冲突,所以,中国制定了GB2312编码,用来把中文编进去。 29 | 30 | 类似的,日文和韩文等其他语言也有这个问题。为了统一所有文字的编码,Unicode应运而生。Unicode把所有语言都统一到一套编码里,这样就不会再有乱码问题了。 31 | 32 | Unicode通常用两个字节表示一个字符,原有的英文编码从单字节变成双字节,只需要把高字节全部填为0就可以。 33 | 34 | 因为Python的诞生比Unicode标准发布的时间还要早,所以最早的Python只支持ASCII编码,普通的字符串'ABC'在Python内部都是ASCII编码的。 35 | 36 | Python在后来添加了对Unicode的支持,以Unicode表示的字符串用u'...'表示,比如: 37 | 38 | print u'中文' 39 | 中文 40 | 注意: 不加 u ,中文就不能正常显示。 41 | 42 | Unicode字符串除了多了一个 u 之外,与普通字符串没啥区别,转义字符和多行表示法仍然有效: 43 | 44 | 转义: 45 | 46 | u'中文\n日文\n韩文' 47 | 多行: 48 | 49 | u'''第一行 50 | 第二行''' 51 | raw+多行: 52 | 53 | ur'''Python的Unicode字符串支持"中文", 54 | "日文", 55 | "韩文"等多种语言''' 56 | 如果中文字符串在Python环境下遇到 UnicodeDecodeError,这是因为.py文件保存的格式有问题。可以在第一行添加注释 57 | 58 | # -*- coding: utf-8 -*- 59 | 目的是告诉Python解释器,用UTF-8编码读取源代码。然后用Notepad++ 另存为... 并选择UTF-8格式保存。 60 | """ -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/hello.py: -------------------------------------------------------------------------------- 1 | print 'Hello Python' 2 | -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/print语句.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Python基本数据类型/print语句.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/raw字符串与多行字符串.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | """ 3 | 任务 4 | 请把下面的字符串用r'''...'''的形式改写,并用print打印出来: 5 | '\"To be, or not to be\": that is the question.\nWhether it\'s nobler in the mind to suffer.' 6 | """ 7 | # 代码 8 | print r'''"To be, or not to be": that is the question. 9 | Whether it's nobler in the mind to suffer.''' 10 | 11 | 12 | """ 13 | raw字符串与多行字符串 14 | 如果一个字符串包含很多需要转义的字符,对每一个字符都进行转义会很麻烦。为了避免这种情况,我们可以在字符串前面加个前缀 r ,表示这是一个 raw 字符串,里面的字符就不需要转义了。例如: 15 | 16 | r'\(~_~)/ \(~_~)/' 17 | 但是r'...'表示法不能表示多行字符串,也不能表示包含'和 "的字符串(为什么?) 18 | 19 | 如果要表示多行字符串,可以用'''...'''表示: 20 | 21 | '''Line 1 22 | Line 2 23 | Line 3''' 24 | 上面这个字符串的表示方法和下面的是完全一样的: 25 | 26 | 'Line 1\nLine 2\nLine 3' 27 | 还可以在多行字符串前面添加 r ,把这个多行字符串也变成一个raw字符串: 28 | 29 | r'''Python is created by "Guido". 30 | It is free and easy to learn. 31 | Let's start learn Python in imooc!''' 32 | """ -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/变量.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Python基本数据类型/变量.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/字符串.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Python基本数据类型/字符串.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/布尔类型.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | ''' 3 | 任务 4 | 请运行如下代码,并解释打印的结果: 5 | 6 | a = 'python' 7 | print 'hello,', a or 'world' 8 | b = '' 9 | print 'hello,', b or 'world' 10 | 11 | 结果: 12 | hello, python 13 | hello, world 14 | 15 | 解释: 16 | 短路运算 17 | a and b 与运算:只有两个布尔值都为 True 时,计算结果才为 True 18 | 若a为false 则结果必为false 所以返回值为a 19 | 若a为true 则结果取决于b, 所以返回值为n 20 | 21 | a or b 或运算:只要有一个布尔值为 True,计算结果就是 True。 22 | 若a为false 则结果取决于b 所以返回值为b 23 | 若a为true 则结果必为true 所以返回值为a 24 | 25 | 另外: 26 | Python把0、空字符串''和None看成 False,其他数值和非空字符串都看成 True 27 | 28 | ''' 29 | 30 | a = 'python' 31 | print 'hello,', a or 'world' 32 | 33 | b = '' 34 | print 'hello,', b or 'world' 35 | 36 | ''' 37 | 布尔类型 38 | 我们已经了解了Python支持布尔类型的数据,布尔类型只有True和False两种值,但是布尔类型有以下几种运算: 39 | 40 | 与运算:只有两个布尔值都为 True 时,计算结果才为 True。 41 | 42 | True and True # ==> True 43 | True and False # ==> False 44 | False and True # ==> False 45 | False and False # ==> False 46 | 或运算:只要有一个布尔值为 True,计算结果就是 True。 47 | 48 | True or True # ==> True 49 | True or False # ==> True 50 | False or True # ==> True 51 | False or False # ==> False 52 | 非运算:把True变为False,或者把False变为True: 53 | 54 | not True # ==> False 55 | not False # ==> True 56 | 布尔运算在计算机中用来做条件判断,根据计算结果为True或者False,计算机可以自动执行不同的后续代码。 57 | 58 | 在Python中,布尔类型还可以与其他数据类型做 and、or和not运算,请看下面的代码: 59 | 60 | a = True 61 | print a and 'a=T' or 'a=F' 62 | 计算结果不是布尔类型,而是字符串 'a=T',这是为什么呢? 63 | 64 | 因为Python把0、空字符串''和None看成 False,其他数值和非空字符串都看成 True,所以: 65 | 66 | True and 'a=T' 计算结果是 'a=T' 67 | 继续计算 'a=T' or 'a=F' 计算结果还是 'a=T' 68 | 要解释上述结果,又涉及到 and 和 or 运算的一条重要法则:短路计算。 69 | 70 | 1. 在计算 a and b 时,如果 a 是 False,则根据与运算法则,整个结果必定为 False,因此返回 a;如果 a 是 True,则整个计算结果必定取决与 b,因此返回 b。 71 | 72 | 2. 在计算 a or b 时,如果 a 是 True,则根据或运算法则,整个计算结果必定为 True,因此返回 a;如果 a 是 False,则整个计算结果必定取决于 b,因此返回 b。 73 | 74 | 所以Python解释器在做布尔运算时,只要能提前确定计算结果,它就不会往后算了,直接返回结果。 75 | ''' -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/数据类型.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | print 45678+0x12fd2 3 | print 'Learn Python in imooc' 4 | print 100 < 99 5 | print 0xff == 255 6 | """ 7 | 数据类型 8 | 计算机顾名思义就是可以做数学计算的机器,因此,计算机程序理所当然地可以处理各种数值。但是,计算机能处理的远不止数值,还可以处理文本、图形、音频、视频、网页等各种各样的数据,不同的数据,需要定义不同的数据类型。在Python中,能够直接处理的数据类型有以下几种: 9 | 10 | 一、整数 11 | 12 | Python可以处理任意大小的整数,当然包括负整数,在Python程序中,整数的表示方法和数学上的写法一模一样,例如:1,100,-8080,0,等等。 13 | 14 | 计算机由于使用二进制,所以,有时候用十六进制表示整数比较方便,十六进制用0x前缀和0-9,a-f表示,例如:0xff00,0xa5b4c3d2,等等。 15 | 16 | 二、浮点数 17 | 18 | 浮点数也就是小数,之所以称为浮点数,是因为按照科学记数法表示时,一个浮点数的小数点位置是可变的,比如,1.23x10^9和12.3x10^8是相等的。浮点数可以用数学写法,如1.23,3.14,-9.01,等等。但是对于很大或很小的浮点数,就必须用科学计数法表示,把10用e替代,1.23x10^9就是1.23e9,或者12.3e8,0.000012可以写成1.2e-5,等等。 19 | 20 | 整数和浮点数在计算机内部存储的方式是不同的,整数运算永远是精确的(除法难道也是精确的?是的!),而浮点数运算则可能会有四舍五入的误差。 21 | 22 | 三、字符串 23 | 24 | 字符串是以''或""括起来的任意文本,比如'abc',"xyz"等等。请注意,''或""本身只是一种表示方式,不是字符串的一部分,因此,字符串'abc'只有a,b,c这3个字符。 25 | 26 | 四、布尔值 27 | 28 | 布尔值和布尔代数的表示完全一致,一个布尔值只有True、False两种值,要么是True,要么是False,在Python中,可以直接用True、False表示布尔值(请注意大小写),也可以通过布尔运算计算出来。 29 | 30 | 布尔值可以用and、or和not运算。 31 | 32 | and运算是与运算,只有所有都为 True,and运算结果才是 True。 33 | 34 | or运算是或运算,只要其中有一个为 True,or 运算结果就是 True。 35 | 36 | not运算是非运算,它是一个单目运算符,把 True 变成 False,False 变成 True。 37 | 38 | 五、空值 39 | 40 | 空值是Python里一个特殊的值,用None表示。None不能理解为0,因为0是有意义的,而None是一个特殊的空值。 41 | 42 | 此外,Python还提供了列表、字典等多种数据类型,还允许创建自定义数据类型,我们后面会继续讲到 43 | 44 | 45 | 46 | 任务 47 | 试一试,在右边编辑器中,完成以下任务: 48 | 49 | 1. 计算十进制整数 45678 和十六进制整数 0x12fd2 之和。 50 | 51 | 2. 请用字符串表示出Learn Python in imooc。 52 | 53 | 3. 请计算以下表达式的布尔值(注意==表示判断是否相等): 54 | 55 | 100 < 99 56 | 57 | 0xff == 255 58 | 59 | 注意:使用print命令 60 | """ -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/整数和浮点数.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | ''' 3 | 任务 4 | 请计算 2.5 + 10 / 4 ,并解释计算结果为什么不是期望的 5.0 ? 5 | 请修复上述运算,使得计算结果是 5.0 6 | ''' 7 | #代码 8 | print 2.5 + 10.0 / 4 9 | 10 | ''' 11 | 整数和浮点数 12 | Python支持对整数和浮点数直接进行四则混合运算,运算规则和数学上的四则运算规则完全一致。 13 | 14 | 基本的运算: 15 | 16 | 1 + 2 + 3 # ==> 6 17 | 4 * 5 - 6 # ==> 14 18 | 7.5 / 8 + 2.1 # ==> 3.0375 19 | 使用括号可以提升优先级,这和数学运算完全一致,注意只能使用小括号,但是括号可以嵌套很多层: 20 | 21 | (1 + 2) * 3 # ==> 9 22 | (2.2 + 3.3) / (1.5 * (9 - 0.3)) # ==> 0.42145593869731807 23 | 和数学运算不同的地方是,Python的整数运算结果仍然是整数,浮点数运算结果仍然是浮点数: 24 | 25 | 1 + 2 # ==> 整数 3 26 | 1.0 + 2.0 # ==> 浮点数 3.0 27 | 但是整数和浮点数混合运算的结果就变成浮点数了: 28 | 29 | 1 + 2.0 # ==> 浮点数 3.0 30 | 为什么要区分整数运算和浮点数运算呢?这是因为整数运算的结果永远是精确的,而浮点数运算的结果不一定精确,因为计算机内存再大,也无法精确表示出无限循环小数,比如 0.1 换成二进制表示就是无限循环小数。 31 | 32 | 那整数的除法运算遇到除不尽的时候,结果难道不是浮点数吗?我们来试一下: 33 | 34 | 11 / 4 # ==> 2 35 | 令很多初学者惊讶的是,Python的整数除法,即使除不尽,结果仍然是整数,余数直接被扔掉。不过,Python提供了一个求余的运算 % 可以计算余数: 36 | 37 | 11 % 4 # ==> 3 38 | 如果我们要计算 11 / 4 的精确结果,按照“整数和浮点数混合运算的结果是浮点数”的法则,把两个数中的一个变成浮点数再运算就没问题了: 39 | 40 | 11.0 / 4 # ==> 2.75 41 | ''' -------------------------------------------------------------------------------- /PythonCode/Python入门/Python基本数据类型/注释.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Python基本数据类型/注释.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Set/set基础.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Set/set基础.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Set/set特点.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | #author: sloop 3 | ''' 4 | 任务 5 | 月份也可以用set表示,请设计一个set并判断用户输入的月份是否有效。 6 | 7 | 月份可以用字符串'Jan', 'Feb', ...表示。 8 | ''' 9 | 10 | #代码 11 | months = set(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']) 12 | x1 = 'Feb' 13 | x2 = 'Sun' 14 | 15 | if x1 in months: 16 | print 'x1: ok' 17 | else: 18 | print 'x1: error' 19 | 20 | if x2 in months: 21 | print 'x2: ok' 22 | else: 23 | print 'x2: error' 24 | 25 | ''' 26 | set的特点 27 | set的内部结构和dict很像,唯一区别是不存储value,因此,判断一个元素是否在set中速度很快。 28 | 29 | set存储的元素和dict的key类似,必须是不变对象,因此,任何可变对象是不能放入set中的。 30 | 31 | 最后,set存储的元素也是没有顺序的。 32 | 33 | set的这些特点,可以应用在哪些地方呢? 34 | 35 | 星期一到星期日可以用字符串'MON', 'TUE', ... 'SUN'表示。 36 | 37 | 假设我们让用户输入星期一至星期日的某天,如何判断用户的输入是否是一个有效的星期呢? 38 | 39 | 可以用 if 语句判断,但这样做非常繁琐: 40 | 41 | x = '???' # 用户输入的字符串 42 | if x!= 'MON' and x!= 'TUE' and x!= 'WED' ... and x!= 'SUN': 43 | print 'input error' 44 | else: 45 | print 'input ok' 46 | 注意:if 语句中的...表示没有列出的其它星期名称,测试时,请输入完整。 47 | 48 | 如果事先创建好一个set,包含'MON' ~ 'SUN': 49 | 50 | weekdays = set(['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']) 51 | 再判断输入是否有效,只需要判断该字符串是否在set中: 52 | 53 | x = '???' # 用户输入的字符串 54 | if x in weekdays: 55 | print 'input ok' 56 | else: 57 | print 'input error' 58 | 这样一来,代码就简单多了。 59 | ''' -------------------------------------------------------------------------------- /PythonCode/Python入门/Set/更新set.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Set/更新set.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Set/访问set.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Set/访问set.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Set/遍历set.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Set/遍历set.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Tuple/Tuple创建.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Tuple/Tuple创建.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Tuple/创建单元素Tuple.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Tuple/创建单元素Tuple.py -------------------------------------------------------------------------------- /PythonCode/Python入门/Tuple/可变的Tuple.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/Tuple/可变的Tuple.py -------------------------------------------------------------------------------- /PythonCode/Python入门/函数/函数入门.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | #author:sloop 3 | #没有代码 4 | 5 | ''' 6 | 什么是函数 7 | 我们知道圆的面积计算公式为: 8 | 9 | S = πr² 10 | 当我们知道半径r的值时,就可以根据公式计算出面积。假设我们需要计算3个不同大小的圆的面积: 11 | 12 | r1 = 12.34 13 | r2 = 9.08 14 | r3 = 73.1 15 | s1 = 3.14 * r1 * r1 16 | s2 = 3.14 * r2 * r2 17 | s3 = 3.14 * r3 * r3 18 | 当代码出现有规律的重复的时候,你就需要当心了,每次写3.14 * x * x不仅很麻烦,而且,如果要把3.14改成3.14159265359的时候,得全部替换。 19 | 20 | 有了函数,我们就不再每次写s = 3.14 * x * x,而是写成更有意义的函数调用 s = area_of_circle(x),而函数 area_of_circle 本身只需要写一次,就可以多次调用。 21 | 22 | 抽象是数学中非常常见的概念。举个例子: 23 | 24 | 计算数列的和,比如:1 + 2 + 3 + ... + 100,写起来十分不方便,于是数学家发明了求和符号∑,可以把1 + 2 + 3 + ... + 100记作: 25 | 26 | 100 27 | ∑n 28 | n=1 29 | 这种抽象记法非常强大,因为我们看到∑就可以理解成求和,而不是还原成低级的加法运算。 30 | 31 | 而且,这种抽象记法是可扩展的,比如: 32 | 33 | 100 34 | ∑(n²+1) 35 | n=1 36 | 还原成加法运算就变成了: 37 | 38 | (1 x 1 + 1) + (2 x 2 + 1) + (3 x 3 + 1) + ... + (100 x 100 + 1) 39 | 可见,借助抽象,我们才能不关心底层的具体计算过程,而直接在更高的层次上思考问题。 40 | 41 | 写计算机程序也是一样,函数就是最基本的一种代码抽象的方式。 42 | 43 | Python不但能非常灵活地定义函数,而且本身内置了很多有用的函数,可以直接调用。 44 | ''' -------------------------------------------------------------------------------- /PythonCode/Python入门/函数/定义可变参数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/函数/定义可变参数.py -------------------------------------------------------------------------------- /PythonCode/Python入门/函数/定义默认参数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/函数/定义默认参数.py -------------------------------------------------------------------------------- /PythonCode/Python入门/函数/编写函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/函数/编写函数.py -------------------------------------------------------------------------------- /PythonCode/Python入门/函数/调用函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/函数/调用函数.py -------------------------------------------------------------------------------- /PythonCode/Python入门/函数/返回多值.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | #author: sloop 3 | 4 | ''' 5 | 任务 6 | 一元二次方程的定义是:ax² + bx + c = 0 7 | 8 | 请编写一个函数,返回一元二次方程的两个解。 9 | 10 | 注意:Python的math包提供了sqrt()函数用于计算平方根。 11 | 请参考求根公式:x = (-b±√(b²-4ac)) / 2a 12 | ''' 13 | 14 | import math 15 | 16 | def quadratic_equation(a, b, c): 17 | t = b*b - 4*a*c 18 | if t < 0: 19 | return 20 | else: 21 | x1 = ( -b+math.sqrt(t) ) / (2*a) 22 | x2 = ( -b-math.sqrt(t) ) / (2*a) 23 | return x1, x2 24 | 25 | print quadratic_equation(2, 3, 0) 26 | print quadratic_equation(1, -6, 5) 27 | 28 | ''' 29 | 返回多值 30 | 函数可以返回多个值吗?答案是肯定的。 31 | 32 | 比如在游戏中经常需要从一个点移动到另一个点,给出坐标、位移和角度,就可以计算出新的坐标: 33 | 34 | # math包提供了sin()和 cos()函数,我们先用import引用它: 35 | 36 | import math 37 | def move(x, y, step, angle): 38 | nx = x + step * math.cos(angle) 39 | ny = y - step * math.sin(angle) 40 | return nx, ny 41 | 这样我们就可以同时获得返回值: 42 | 43 | >>> x, y = move(100, 100, 60, math.pi / 6) 44 | >>> print x, y 45 | 151.961524227 70.0 46 | 但其实这只是一种假象,Python函数返回的仍然是单一值: 47 | 48 | >>> r = move(100, 100, 60, math.pi / 6) 49 | >>> print r 50 | (151.96152422706632, 70.0) 51 | 用print打印返回结果,原来返回值是一个tuple! 52 | 53 | 但是,在语法上,返回一个tuple可以省略括号,而多个变量可以同时接收一个tuple,按位置赋给对应的值,所以,Python的函数返回多值其实就是返回一个tuple,但写起来更方便。 54 | ''' -------------------------------------------------------------------------------- /PythonCode/Python入门/函数/递归函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/函数/递归函数.py -------------------------------------------------------------------------------- /PythonCode/Python入门/切片/倒序切片.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/切片/倒序切片.py -------------------------------------------------------------------------------- /PythonCode/Python入门/切片/字符串切片.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/切片/字符串切片.py -------------------------------------------------------------------------------- /PythonCode/Python入门/切片/对List进行切片.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/切片/对List进行切片.py -------------------------------------------------------------------------------- /PythonCode/Python入门/列表生成器/复杂表达式.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/列表生成器/复杂表达式.py -------------------------------------------------------------------------------- /PythonCode/Python入门/列表生成器/多层表达式.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/列表生成器/多层表达式.py -------------------------------------------------------------------------------- /PythonCode/Python入门/列表生成器/条件过滤.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/列表生成器/条件过滤.py -------------------------------------------------------------------------------- /PythonCode/Python入门/列表生成器/生成列表.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/列表生成器/生成列表.py -------------------------------------------------------------------------------- /PythonCode/Python入门/条件判断和循环/break退出循环.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/条件判断和循环/break退出循环.py -------------------------------------------------------------------------------- /PythonCode/Python入门/条件判断和循环/continue继续循环.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/条件判断和循环/continue继续循环.py -------------------------------------------------------------------------------- /PythonCode/Python入门/条件判断和循环/for循环.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/条件判断和循环/for循环.py -------------------------------------------------------------------------------- /PythonCode/Python入门/条件判断和循环/if-else.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/条件判断和循环/if-else.py -------------------------------------------------------------------------------- /PythonCode/Python入门/条件判断和循环/if-elseif-else.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/条件判断和循环/if-elseif-else.py -------------------------------------------------------------------------------- /PythonCode/Python入门/条件判断和循环/if语句.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/条件判断和循环/if语句.py -------------------------------------------------------------------------------- /PythonCode/Python入门/条件判断和循环/while循环.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/条件判断和循环/while循环.py -------------------------------------------------------------------------------- /PythonCode/Python入门/条件判断和循环/多重循环.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/条件判断和循环/多重循环.py -------------------------------------------------------------------------------- /PythonCode/Python入门/迭代/索引迭代.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/迭代/索引迭代.py -------------------------------------------------------------------------------- /PythonCode/Python入门/迭代/迭代.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/迭代/迭代.py -------------------------------------------------------------------------------- /PythonCode/Python入门/迭代/迭代dict中的key和value.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/迭代/迭代dict中的key和value.py -------------------------------------------------------------------------------- /PythonCode/Python入门/迭代/迭代dict中的value.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python入门/迭代/迭代dict中的value.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/filter函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/filter函数.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/map函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/map函数.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/reduce函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/reduce函数.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/偏函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/偏函数.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/函数式编程简介.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/函数式编程简介.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/匿名函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/匿名函数.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/完善decorator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/完善decorator.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/带参decorator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/带参decorator.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/无参decorator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/无参decorator.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/自定义排序函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/自定义排序函数.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/装饰器-decorator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/装饰器-decorator.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/返回函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/返回函数.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/闭包.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/闭包.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/函数编程/高阶函数.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/函数编程/高阶函数.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/@property.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/@property.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/__call__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/__call__.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/__cmp__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/__cmp__.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/__len__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/__len__.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/__slots__限制属性.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/__slots__限制属性.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/__str__和__repr__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/__str__和__repr__.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/数学运算.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/数学运算.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/特殊方法.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/特殊方法.txt -------------------------------------------------------------------------------- /PythonCode/Python进阶/定制类/类型转换.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/定制类/类型转换.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/模块/使用__future__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/模块/使用__future__.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/模块/动态导入模块.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/模块/动态导入模块.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/模块/导入模块.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/模块/导入模块.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/模块/导入第三方模块.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/模块/导入第三方模块.txt -------------------------------------------------------------------------------- /PythonCode/Python进阶/模块/模块和包的概念.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/模块/模块和包的概念.txt -------------------------------------------------------------------------------- /PythonCode/Python进阶/类的继承/判断类型.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/类的继承/判断类型.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/类的继承/多态.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/类的继承/多态.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/类的继承/多重继承.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/类的继承/多重继承.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/类的继承/类的继承.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/类的继承/类的继承.txt -------------------------------------------------------------------------------- /PythonCode/Python进阶/类的继承/继承一个类.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/类的继承/继承一个类.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/类的继承/获取对象信息.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/类的继承/获取对象信息.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/创建实例属性.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/创建实例属性.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/创建类属性.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/创建类属性.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/初始化实例属性.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/初始化实例属性.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/定义实例方法.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/定义实例方法.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/定义类并创建实例.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/定义类并创建实例.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/定义类方法.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/定义类方法.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/方法也是属性.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/方法也是属性.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/类属性和实例属性名字冲突.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/类属性和实例属性名字冲突.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/访问限制.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/访问限制.py -------------------------------------------------------------------------------- /PythonCode/Python进阶/面向对象基础/面向对象.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonCode/Python进阶/面向对象基础/面向对象.txt -------------------------------------------------------------------------------- /PythonTools/Tools/factorial.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonTools/Tools/factorial.py -------------------------------------------------------------------------------- /PythonTools/Tools/log.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonTools/Tools/log.py -------------------------------------------------------------------------------- /PythonTools/Tools/performace.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GcsSloop/PythonNote/bfcc5aaa8f8639a8acc2108a0334422883e038d9/PythonTools/Tools/performace.py -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PythonNote 2 | 我的Python学习笔记。 3 | 4 | 如果出现链接失效的情况可以提交Issues提醒我修改相关内容。 5 | ### 作者微博: [@安卓攻城师sloop](http://weibo.com/5459430586) 6 | 7 | ### Python相关资料: 8 | 9 | 相关资料 | 链接 | 备注 10 | --- | --- | --- 11 | Python导航 | [www.python5.com](http://www.python5.com/) | 12 | Python官网 | [www.python.org](https://www.python.org/) | 13 | Python课程 | [慕课网](http://www.imooc.com/course/list?c=python) | 视频 + 代码 14 | Python教程 | [廖雪峰](http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000) | 博客 15 | EditPlus | [EditPlus](https://github.com/GcsSloop/PythonNote/tree/master/PDT) | 我学习python用的开发工具 16 | EditPlus | [EditPlus使用技巧](https://github.com/GcsSloop/PythonNote/blob/master/PDT/EditPlus%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7.md) | 使用技巧 17 | 18 | ### Python可以做的有趣的东西 19 | 链接 | 说明 20 | --- | --- 21 | [Python也可以](http://blog.csdn.net/column/details/python-can.html) | 一些看起来非常高大上的东西如何用Python实现 22 | 23 | ### 说明: 24 | 名称 | 说明 25 | --- | --- 26 | Art | 图片 27 | PDT | Python开发工具 28 | PythonCode | 学习代码库 29 | PythonTool | 可复用的代码 30 | Issues | 记录学习过程遇到的错误和好的点子 31 | 32 | ## About Me 33 | 34 | ### 作者微博: [@GcsSloop](http://weibo.com/GcsSloop) 35 | 36 | 37 | 38 | --------------------------------------------------------------------------------