
python
莫冲
TO Be SIMPLE & STUDPID
展开
-
Beautiful soup安装初运行遇到的问题解决
1、 下载:https://www.crummy.com/software/BeautifulSoup/#Download2、文档:https://www.crummy.com/software/BeautifulSoup/bs4/doc/3、安装,两种方法:1、windows下cmd进入bs根目录:C:\Python34\python.exe setup...原创 2016-12-17 22:16:04 · 296 阅读 · 0 评论 -
[effective python]改善python代码的91个建议-chapter2
编程惯例[code="java"]1 assertx = 1y = 2assert x == y, "Not equals"[/code]python -O .\asserttest.py # 加上-O 参数禁止断言## 建议9 数据交换值不推荐使用中间变量[code="java"]x = 1y = 2y, x = x, yprint xprin...原创 2016-09-28 14:32:57 · 134 阅读 · 0 评论 -
[effective python]改善python代码的91个建议-chapter1
## 建议1 使用pep8校验代码规范性pep8 --first test.py长字符串换[code="java"]print 'You\'d need to know \'bout escapes with' \ '\\ that do \n newlines and \t tabs.'[/code]或[code="java"]print ('You\'d ne...原创 2016-09-28 13:58:58 · 170 阅读 · 0 评论 -
python学习
来源:http://www.runoob.com/python3/python3-class.html元组元组中只包含一个元素时,需要在元素后面添加逗号tup1 = (50,);如果写成tup1 = (50);不会报错,因为会当成int创建,但是如果执行tup1[0]就会报错了。--------------------python的逻辑运算符 and or ...原创 2016-09-01 16:07:22 · 114 阅读 · 0 评论 -
Beautiful soup安装初运行遇到的问题解决
1、 下载:https://www.crummy.com/software/BeautifulSoup/#Download2、文档:https://www.crummy.com/software/BeautifulSoup/bs4/doc/3、安装,两种方法:1、windows下cmd进入bs根目录:C:\Python34\python.exe setup.py instal原创 2017-03-28 14:42:15 · 957 阅读 · 0 评论 -
[effective python]改善python代码的91个建议-chapter2
编程惯例1 assertx = 1y = 2assert x == y, "Not equals"python -O .\asserttest.py # 加上-O 参数禁止断言## 建议9 数据交换值不推荐使用中间变量x = 1y = 2y, x = x, yprint xprint y遇到表达式赋值表达式的右边操作数优先于左边的操作数计算,例如ex原创 2017-03-28 14:39:10 · 277 阅读 · 0 评论 -
[effective python]改善python代码的91个建议-chapter1
## 建议1 使用pep8校验代码规范性pep8 --first test.py长字符串换print 'You\'d need to know \'bout escapes with' \ '\\ that do \n newlines and \t tabs.'或print ('You\'d need to know \'bout escapes with'原创 2017-03-28 14:39:01 · 523 阅读 · 0 评论 -
[python]import 与from import 区别
http://www.cnblogs.com/ptfblog/archive/2012/07/15/2592122.html建议有节制的使用from import1 尽量优先使用import a,import a.B2 有节制使用from a import B 3 尽量避免使用from a import * 会污染命名空间 A 会导致命名空间冲突例如a.py,b.py都有add 函原创 2017-03-28 14:38:46 · 1053 阅读 · 0 评论 -
python学习
来源:http://www.runoob.com/python3/python3-class.html元组元组中只包含一个元素时,需要在元素后面添加逗号tup1 = (50,);如果写成tup1 = (50);不会报错,因为会当成int创建,但是如果执行tup1[0]就会报错了。--------------------python的逻辑运算符 and or notand :x原创 2017-03-28 14:38:18 · 232 阅读 · 0 评论