码迷,mamicode.com
首页 > 编程语言 > 详细

python问题总结

时间:2018-05-08 19:22:30      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:python   开发问题总结   

python练习:爬取淘宝网商品、规格、评论信息存入数据库,页面支持简单的搜索展示

成果:https://github.com/PrettyPanda/MyTaoBao/tree/master

成果展示:

技术分享图片


python问题总结:

1.UnicodeEncodeError:'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256) Scrapy

参考地址:

https://www.cnblogs.com/Skrillex/p/7093488.html

https://blog.csdn.net/mayuko2012/article/details/59126290

https://blog.csdn.net/csdnwws/article/details/51954825


2.python三种字符串链接方式:

https://www.cnblogs.com/chenjingyi/p/5741901.html +  join  %替换



3.pymysql.err.InternalError: (1366, "Incorrect string value: '\\xE7\\xAC\\x94\\xE8\\xAE\\xB0...' for column 'title' at row 1")

参考地址:https://blog.csdn.net/u011242745/article/details/51660344



4.Python uuid的使用

https://www.cnblogs.com/dkblog/archive/2011/10/10/2205200.html



5.TypeError: not all arguments converted during string formatting

缺少%s、%d


6.TypeError: 'NoneType' object is not subscriptable



7.mac配置cgi

mac自带cgi

https://blog.csdn.net/zhzdeng/article/details/52608199

加载文本,不执行脚本问题:http://blog.51cto.com/xpleaf/1740221  需要打开模块



8.httpd 

https://blog.csdn.net/wangye1989_0226/article/details/72782103



9.UnicodeEncodeError: 'ascii' codec can't encode characters in position 20-24: ordinal not in range(128)

https://blog.csdn.net/love_rongrong/article/details/17119261  保存文件是得是中文


在脚本前加上如下两句即可正常显示中文。

https://blog.csdn.net/zhanyongjia_cnu/article/details/77996055

import codecs, sys 

sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer)



10.End of script output before headers

脚本有问题哈



11.Permission denied: AH01241: exec of '/Users/panda/PycharmProjects/untitled/test/web/cgi/first.py' failed

权限问题



12.python like语句的问题

https://blog.csdn.net/chenxiao_ji/article/details/51332791


python问题总结

标签:python   开发问题总结   

原文地址:http://blog.51cto.com/13496382/2114117

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!