随笔分类 -  Python

摘要:文本获取:ThreeKingdoms.txt(三国演义.txt):https://python123.io/resources/pye/threekingdoms.txt 因为文本是复制到txt文档中的,第一次提示编码错误:'utf-8' codec can't decode byte 0xc8 i 阅读全文
posted @ 2021-11-22 15:42 吉祥知知 阅读(689) 评论(0) 推荐(0)
摘要:哈姆雷特文本分析记录: def getText(): txt = open("hamlet.txt","r").read() #打开文件 r 读权限 txt = txt.lower() #把英文字母全部变成小写 for ch in '!"$%&()*+,-./:;<=>?@[\\]^_{|}~': 阅读全文
posted @ 2021-11-22 14:33 吉祥知知 阅读(1519) 评论(0) 推荐(0)
摘要:运行--cmd pip install requests 第一次运行的时候报错了,看了一下执行python目录是正确的(因为电脑安装了2个python) 关闭cmd,重新打开再次运行就正常了。 阅读全文
posted @ 2020-08-17 10:55 吉祥知知 阅读(84) 评论(0) 推荐(0)