![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
_Hothan
默默努力的小白
展开
-
Python易混淆知识(持续更新)
readline() readline() 方法用于从文件读取整行,包括 “\n” 字符。如果指定了一个非负数的参数,则返回指定大小的字节数,包括 “\n” 字符。 filename = "example.txt" with open(filename, 'r', encoding='utf-8') as t: while True: line = t.readline()...原创 2020-04-16 18:12:24 · 202 阅读 · 0 评论 -
爬取西宁2016-2018.4月之间的天气情况(Python)
import requests import re import xlwt def getHTMLText(url): # 得到网页文件 try: r = requests.get(url, timeout=30) r.raise_for_status() r.encoding = r.apparent_encoding # 转换...原创 2018-05-01 16:54:48 · 275 阅读 · 0 评论