
Python Learn
文章平均质量分 63
fzzjoy
Code Change World
展开
-
python中列表,元组,字符串互相转换
列表元素转换为字符串:>>> a=['hello']>>> b=''.join(a)>>> b'hello'>>> a=['hello','python']>>> b=''.join(a[1])>>> >>> b'python'>>> 列表元素转换为元组:原创 2015-05-21 16:46:14 · 10816 阅读 · 0 评论 -
super函数
先看一个例子:class Bird(object): def __init__(self): self.hungry=True def eat(self): if self.hungry: print 'Aaaah...' self.hungry=False else:原创 2016-01-01 20:15:44 · 507 阅读 · 0 评论 -
Python变量访问范围
case1:# -*- coding: utf-8 -*-'''Created on 2016年1月29日@author: zhouzhou'''class MemberCounter(object): members=-1 def count(self): self.members+=1if __name__ == "__main__":原创 2016-01-29 15:27:26 · 1005 阅读 · 0 评论 -
Python网络爬虫
1、首先对目标站点的规模和结构进行一定的了解检查robots.txt文件大多数网站都会定义robots.txt文件,这样可以让爬虫了解爬取该网站时存在哪些限制。查看Sitemap文件(即网站地图)网站地图提供了所有网页的链接,可以帮助爬虫定位网站最新的内容,而无需爬取每一个网页。2、下载网页3、抓取数据爬取(crawling) 为了抓取网站,我们首先需要下载包含有...原创 2021-01-31 15:29:33 · 268 阅读 · 0 评论 -
Python 知识点
python memo原创 2019-08-22 16:39:09 · 152 阅读 · 0 评论