Python
躺赢
这个作者很懒,什么都没留下…
展开
-
logger日志的坑
Traceback (most recent call last): File "D:\python-2.7.16.amd64\lib\logging\__init__.py", line 889, in emit stream.write(fs % msg)IOError: [Errno 0] ErrorLogged from file practice_str.py, line 14结论:编辑器运行时,logger打印日志中任何字符都可以正常运行 命令行运行时...原创 2020-09-15 19:53:12 · 824 阅读 · 0 评论 -
python中is和==的区别
is :比较的是对象的id ==:比较的是对象的值 对于list,dict,tuple,set 只要重新定义就会产生新的id 对于字符串,数值,都是同一个id #coding=utf-8# 数值a=9b=9# Trueprint a is b# 字符串a="hhh"b="hhh"# Trueprint a is b# 字典a={'a':2}b={'a':2}# Falseprint a is b ...原创 2020-09-15 19:42:48 · 120 阅读 · 0 评论 -
爬虫(一)
import urllib.requestimport osimport randomdef open_url(url): req = urllib.request.Request(url) req.add_header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64;...原创 2019-11-12 20:12:17 · 484 阅读 · 0 评论 -
Fatal error in launcher: Unable to create process using '"f:\python\environment\python.exe"
使用命令:python -m pip install --upgrade pip原创 2019-11-07 16:17:26 · 1220 阅读 · 0 评论