04 2021 档案
摘要:在爬虫有一些需求需要把多个空格替换一个或者是把多个相同的字符值保留一个,实现方法用re.sub 直接上代码 strs = "核算处 期" new_strs = re.sub(r" +",' ', strs) print(new_strs) strs = "核算处 期" new_strs = re.s
阅读全文
摘要:今天想知道for循环的速度,所以做一下测试 1. for循环一万次 耗时2毫秒 2. for循环十万次 耗时22毫秒 3. for循环一百万次 耗时304毫秒 4. for循环一千万次 耗时2337毫秒,也就是2.3秒 5. for循环一亿次 耗时23468毫秒,也就是23.4秒 为什么要做这个测试
阅读全文
摘要:1 . python3 环境 python3 content 输出是 bytes text 输出是 str python 2 环境 python2 content 输出是 str text 输出是 unicode
阅读全文
摘要:https://www.cnblogs.com/AllBloggers.aspx
阅读全文
摘要:直接上代码备忘 import smtplib from email.mime.text import MIMEText from email.header import Header from email.mime.multipart import MIMEMultipart def send_em
阅读全文