随笔分类 - python
摘要:import pyttsx3 as pyt engine = pyt.init() engine.say('这是一个练习') engine.runAndWait() No module named "pythoncom" 解决方法 pip install pypiwin32
阅读全文
摘要:在打开文件时启用编码格式file = open("yue.txt",'w',encoding='utf-8') import urllib.requestimport redata = urllib.request.urlopen('#').read().decode("utf-8")pat ='<
阅读全文
摘要:#Author:yue# f = open("yue",'r',encoding='utf8')# g = open("test")# data = f.read()# print(data)# print(g.read())## f.close()# g.close()# # 文件打开模式,只读,
阅读全文
摘要:安装第三方包 时可以指定豆瓣的源 pip install package -i --trusted-host site(http:/.pypi.douban.com/simple)
阅读全文
摘要:# for item in info:# print(item)## for item in info.keys():# print(item) # for item in info.values():# print(item)
阅读全文
摘要:#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
阅读全文
摘要:环境:Win10 python3 下载地址:http://www.crummy.com/software/BeautifulSoup/bs4/download/4.3/ 下载之后解压,我直接将其解压在桌面,进入命令行模式 进入其文件夹: 运行命令: python setup.py install 以
阅读全文
摘要:urllib.urlretrieve()在python2中可以直接使用,e而在python3中则需要 urllib.request.urlretrieve() urllib.request.urlretrieve()
阅读全文
摘要:新手学习爬虫 环境:win10 python3.6 记录一下中途出现的错误: 1、cannot use a string pattern on a bytes-like object 2、 return _compile(pattern, flags) raise source.error("unb
阅读全文
摘要:python3.6 Win10系统安装lxml 首先使用指令查看能安装的版本,然后在命令行安装 如上图
阅读全文