摘要: import re #在Python中正则表达式的使用 #findall() #match() #search() #第一个参数为正则表达式,第二个参数为要检索的字符串 #result=re.findall('Hi',s) #findall()查找字符串中所有满足正则表达式规律的内容,并将结果依次保存在列表中 #result=re.match('hi') #match()从字符串开头位置... 阅读全文
posted @ 2018-01-18 21:34 minkillmax 阅读(114) 评论(0) 推荐(0) 编辑
摘要: from urllib.parse import quote,unquote #字节码 #%E6%88%90%E9%83%BD #quote 字符串-字节码 编码 #unquote 字节码-字符串 解码 s='成都' s1=quote(s,encoding='utf8') print(s1) s4=unquote(s1) print(s4) #字节码 #\xe6\x88\x90\x... 阅读全文
posted @ 2018-01-18 21:33 minkillmax 阅读(222) 评论(0) 推荐(0) 编辑
摘要: from time import time,sleep now1=time() #import urllib.request #urllib.request.urlretrieve() #from urllib import request #request.urlretrieve() def abc1(a,b,c): print(a) #a接收的是下载过程中数据包的序号 ... 阅读全文
posted @ 2018-01-18 21:31 minkillmax 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #open() #urlopen() #方法名称不同 #参数不同 #只能以只读模式打开网络资源文件包名就是一个文件夹,包含许多的模块模块就是一个文件,文件里包含其他的函数之类的。详解:https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/0014318447437605e90206e... 阅读全文
posted @ 2018-01-18 21:30 minkillmax 阅读(416) 评论(0) 推荐(0) 编辑
摘要: import pymysql conn=pymysql.connect(host='192.168.8.30',port=3306,user='root',password='123456',db='hzdl',charset='utf8') cur=conn.cursor() while True: #提示用户输入账号 print('请输入账号:') #接收用户的输入... 阅读全文
posted @ 2018-01-18 21:28 minkillmax 阅读(133) 评论(0) 推荐(0) 编辑