随笔- 807  文章- 150  评论- 23  阅读- 151万 

随笔分类 -  Python 报错与处理

Python报错:pymongo.errors.CursorNotFound: Cursor not found
摘要:python报错:pymongo.errors.CursorNotFound: Cursor not found 背景: 从数据库中取得所有数据 db['test'].find({},{_id:0}),然后对结果进行for循环 demos = db['demo'].find({},{"_id": 0 阅读全文
posted @ 2020-01-17 15:19 xibuhaohao 阅读(489) 评论(0) 推荐(0) 编辑
Linux socket.error: [Errno 99] Cannot assign requested
摘要:Python 使用 from pymongo import MongoClient 连接mongodb,由于没有关闭连接,导致 netstat -alnt|wc -l达到几万个 socket.error: [Errno 99] Cannot assign requested address 网上你去 阅读全文
posted @ 2020-01-08 11:47 xibuhaohao 阅读(1194) 评论(0) 推荐(0) 编辑
Python pymongo 中文乱码问题
摘要:原文地址:http://windkeepblow.blog.163.com/blog/static/1914883312013988185783/ 如题,其实我的问题很简单,就是在写爬虫的时候拿到网页的信息包含类似“\u65b0\u6d6a\u5fae\u535a\u6ce8\u518c”的字符串, 阅读全文
posted @ 2019-12-26 14:45 xibuhaohao 阅读(973) 评论(0) 推荐(0) 编辑
MongoDB SyntaxError: Non-ASCII character '\xe4' in file test1.py on line 8, but no encoding declared;
摘要:SyntaxError: Non-ASCII character '\xe4' in file test1.py on line 8, but no encoding declared; python脚本内容 1、原因 Python默认是以ASCII作为编码方式的,需要在文件开头设置一下编码 2、解 阅读全文
posted @ 2019-12-26 14:20 xibuhaohao 阅读(490) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示