
python
hcldh
勿在浮沙筑高台
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python 中文编码声明
# coding=utf-8 score = 80 if score>60 : print("很好") elif score>40 : print("差") 要在开头声明# coding=utf-8但是要注意的是 = 号两边不能有空格,不然不会生效。原创 2016-03-09 23:20:28 · 1491 阅读 · 0 评论 -
python 学习
1.声明 a = 2 b = 3 c =a + b; 2.判断 if a>3 : print("hahah") 3.循环 for i in range(0,100): print(i) 4 字符串拼接 for i in range(0,100): print("item {0}{1}".format(i,"hello wor原创 2016-03-09 23:33:01 · 328 阅读 · 0 评论 -
BeautifulSoup demo
# coding:utf8 from bs4 import BeautifulSoup import urllib2url = "http://www.baidu.com" response = urllib2.urlopen(url) str = response.read()soup = BeautifulSoup(str, 'html.parser',原创 2016-12-20 10:48:05 · 787 阅读 · 0 评论