
python实战
本专栏是在用python实战开发的过程中遇到的一些常规错误的解决方案以及关于python开发中的一些技术博客
wuliZs_
调试的错误就是编程给你最好的东西,因为在每个错误上面都标志着前进的一步。
展开
-
error: can't copy 'docx/templates/default-docx-template': doesn't exist or not a regular file解决方法
今天用python的pip安装模块python - docx的时候报错,看了很多文章解决了该问题!大致报错如下 copying docx/text/paragraph.py -> build/lib/docx/text creating build/lib/docx/oxml/text copying docx/oxml/text/run.py -> bui...原创 2019-01-14 19:50:46 · 6382 阅读 · 4 评论 -
UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xe6 in position解决方法
python2.x的默认编码是ascii,而代码中可能由utf-8的字符导致,解决方法是设置utf-8if sys.getdefaultencoding() != 'utf-8': reload(sys) sys.setdefaultencoding('utf-8')参考:https://blog.youkuaiyun.com/jewelsu/article/details/7868...原创 2019-01-15 15:31:46 · 39250 阅读 · 4 评论 -
python datetime.datetime is not JSON serializable 报错问题解决
1、问题描述使用python自带的json,将数据转换为json数据时,datetime格式的数据报错:datetimeTypeError: datetime.datetime(2017, 3, 21, 2, 11, 21) is not JSON serializable。2、解决方法就是重写构造json类,遇到日期特殊处理,其余的用内置的就行。import json fr...原创 2019-01-16 18:07:36 · 2297 阅读 · 3 评论 -
Python基础学习:关键字from
关键字from一般用于类的导入,其格式为:from 模块名(即类所处的文件名)import 类名导入的类中的方法要被使用必须采取: 模块名.方法名()...原创 2018-11-15 15:12:48 · 561 阅读 · 1 评论