Python
屯庆笔记
用于作笔记的
展开
-
Python里的rang()和xrang()之间有什么区别
在python2中,rang() 和 xrang() 经常用来做for循环在python3中,去掉了python2中的 rang() ,把 xrang() 改成了 rang()区别:range([start,] stop[, step]),根据start与stop指定的范围以及step设定的步长,生成一个序列。比如:>>> range(5) [0, 1, 2, 3, ...转载 2020-01-06 14:42:41 · 1424 阅读 · 0 评论 -
python 获取桌面的文件夹先获取桌面的路径才行
桌面的路径 def get_desk_p(self): return os.path.join(os.path.expanduser('~'), "Desktop")原创 2019-10-25 14:48:17 · 2549 阅读 · 0 评论 -
python pandas导出excel到本地的时候出现乱码
直接加上编码self.df = pandas.DataFrame(self.headers, index=[0])self.df.to_excel(self.filename, index=False, encoding='utf-8')原创 2019-10-25 14:46:19 · 4409 阅读 · 0 评论 -
python 运用Pyqt5的时候,遇到界面卡死问题
参考他人CSDN PyQt5+socket编程界面卡住未响应解决这个问题 加上线程th = threading.Thread(target=self.*, args=(*, *))th.start()原创 2019-10-25 14:43:48 · 11313 阅读 · 4 评论 -
python 爬虫百度地图的界面
在爬虫百度地图的期间,就为它做了一个界面,运用的是PyQt5。得到意想不到的结果:# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'E:\pycharm_workspase\sprider_baidumap\src\view\provinces.ui'## Created by:...原创 2019-10-25 14:26:52 · 1136 阅读 · 1 评论 -
python 爬取百度地图页面得到商家相关的信息
爬取地图之后,是不是以为数据就百度地图显示在150条数据,但那是不可能的。获取百度地图json的数据: response = requests.get(url, headers=headers, timeout=60) response.encoding = 'utf-8' data = response.text jdata = json.loads(data) ...原创 2019-10-25 14:17:57 · 2600 阅读 · 1 评论 -
40:447: execution error: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020
40:447: execution error: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of ...原创 2019-09-14 10:47:30 · 9238 阅读 · 1 评论