随笔分类 -  python

摘要:import pyttsx3 as pyt engine = pyt.init() engine.say('这是一个练习') engine.runAndWait() No module named "pythoncom" 解决方法 pip install pypiwin32 阅读全文
posted @ 2020-03-28 23:43 端木祈月 阅读(1526) 评论(0) 推荐(0)
摘要:在打开文件时启用编码格式file = open("yue.txt",'w',encoding='utf-8') import urllib.requestimport redata = urllib.request.urlopen('#').read().decode("utf-8")pat ='< 阅读全文
posted @ 2019-07-04 22:22 端木祈月 阅读(1159) 评论(0) 推荐(0)
摘要:#Author:yue# f = open("yue",'r',encoding='utf8')# g = open("test")# data = f.read()# print(data)# print(g.read())## f.close()# g.close()# # 文件打开模式,只读, 阅读全文
posted @ 2018-08-27 23:49 端木祈月 阅读(213) 评论(0) 推荐(0)
摘要:安装第三方包 时可以指定豆瓣的源 pip install package -i --trusted-host site(http:/.pypi.douban.com/simple) 阅读全文
posted @ 2018-08-21 23:34 端木祈月 阅读(231) 评论(0) 推荐(0)
摘要:# for item in info:# print(item)## for item in info.keys():# print(item) # for item in info.values():# print(item) 阅读全文
posted @ 2018-08-07 23:17 端木祈月 阅读(129) 评论(0) 推荐(0)
摘要:#Author:yue#列表li=[1,2,3,4,5]# 1.值的追加# li.append(5)# print(li)# [1, 2, 3, 4, 5, 5]# li.append('yue')# print(li)# [1, 2, 3, 4, 5, 'yue']# 2.清空列表# li.cle 阅读全文
posted @ 2018-08-06 21:58 端木祈月 阅读(244) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2018-08-02 21:02 端木祈月 阅读(2) 评论(0) 推荐(0)
摘要:环境:Win10 python3 下载地址:http://www.crummy.com/software/BeautifulSoup/bs4/download/4.3/ 下载之后解压,我直接将其解压在桌面,进入命令行模式 进入其文件夹: 运行命令: python setup.py install 以 阅读全文
posted @ 2018-03-30 20:43 端木祈月 阅读(122) 评论(0) 推荐(0)
摘要:urllib.urlretrieve()在python2中可以直接使用,e而在python3中则需要 urllib.request.urlretrieve() urllib.request.urlretrieve() 阅读全文
posted @ 2018-03-29 22:00 端木祈月 阅读(236) 评论(0) 推荐(0)
摘要:新手学习爬虫 环境:win10 python3.6 记录一下中途出现的错误: 1、cannot use a string pattern on a bytes-like object 2、 return _compile(pattern, flags) raise source.error("unb 阅读全文
posted @ 2018-03-28 21:59 端木祈月 阅读(693) 评论(0) 推荐(1)
摘要:python3.6 Win10系统安装lxml 首先使用指令查看能安装的版本,然后在命令行安装 如上图 阅读全文
posted @ 2018-03-26 21:33 端木祈月 阅读(210) 评论(0) 推荐(0)