
python
Martin Tai
这个作者很懒,什么都没留下…
展开
-
query=query.decode(errors=‘replace‘) AttributeError: ‘str‘ object has no attribute ‘decode‘
query=query.decode(errors=‘replace’) AttributeError: ‘str’ object has no attribute ‘decode’ 在进行Djang迁移步骤过程中,报这样的错 Stack Overflow上提出了解决方案 我使用了更改operations文件 问题原因应该是使用了Django2.2.x 和 pymysql 导致的 成功解决 ...原创 2021-05-08 10:27:08 · 713 阅读 · 2 评论 -
pycharm的使用
社区版本 增加DataSource 安装插件database navigator 快捷键 ⌥ ⇧ ⏎ --> 自动提示补全 ⌘ p --> 提示参数 ⌥ ⇧ ↑ --> 向上移动 ⌥ ⇧ ↓ --> 向下移动原创 2021-05-08 10:25:25 · 188 阅读 · 1 评论 -
[解决]UnicodeEncodeError: ‘ascii‘ codec can‘t encode characters
问题 出错截图: 原因: python不支持汉字 只支持ascii码 错误代码???? def get_page_with_para(): para = "哈哈" url = "http://www.baidu.com/s?wd=" url = url + para print(url) response = urllib.request.urlopen(url) data = response.read().decode("utf-8") wi原创 2020-08-05 22:23:25 · 1678 阅读 · 0 评论