python-->django使用过程中碰到的异常总结
2015-08-24 21:24
645 查看
1.
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xa1 in position 0:
invalid start byte:
这是因为代码中有中文字符,在网上搜了一下,可以用 u("中文").encode("utf-8")
或者 unicode(“中文”).encode("utf-8")来解决,
为了简单起见,先直接简单粗暴,干掉中文。
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xa1 in position 0:
invalid start byte:
这是因为代码中有中文字符,在网上搜了一下,可以用 u("中文").encode("utf-8")
或者 unicode(“中文”).encode("utf-8")来解决,
为了简单起见,先直接简单粗暴,干掉中文。
相关文章推荐
- python中用filter求素数
- python把str转换为int
- 在python中如何设置当前工作目录
- Python学习笔记:random模块
- python第三方库推荐 - dateutil
- Python 实现递归算法
- python 模块学习--Numpy
- python实现简单爬虫功能
- python常用模块
- Python中文件对象的访问模式
- python_学习笔记0824
- Python自然语言处理学习笔记之信息提取步骤&分块(chunking)
- Python写Excel文件
- Python学习笔记:概要
- python嵌套dict的深度遍历合并
- 在VS中安装Python
- python ftplib模块
- python中的read()、readline()与readlines()
- python 使用ioctl() 获得网卡IP 和MAC地址
- python字符串format函数学习