![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
剑侠365
这个作者很懒,什么都没留下…
展开
-
在python3.3后urllib2已经不能再用,只能用urllib.request来代替
在python3.3后urllib2已经不能再用,只能用urllib.request来代替 如在python3.3.0中运行一下脚本 import urllib2response=urllib2.urlopen('http://www.baidu.com')html=response.read()print(html) 提示找不到“urllib2”模块Traceback (most rece原创 2016-01-25 11:08:18 · 22865 阅读 · 1 评论 -
'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)
python flask 中出现这个报错'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)根据提示可知是涉及到了编码问题 将.py文件中开头加入如下代码 #! /usr/bin/env python # -*- coding: utf-8 -*- import sys reloa原创 2016-02-18 15:36:07 · 1468 阅读 · 0 评论