python
文章平均质量分 57
菜鸟鱼
这个作者很懒,什么都没留下…
展开
-
python串口模块
在windows系统中,我们可以在dos中用pip install serial来下载serial或用pip install pyserial来下载。如果用pychar 可以通过File—>setting进入下图界面,通过右边的+号来添加serial模块。然后我在使用serial.Serial时,总是提示错误module 'serial' has no attribute 'Serial'通...原创 2018-04-30 16:15:19 · 1843 阅读 · 0 评论 -
用python接受tgam的脑波数据
# -*- coding: utf-8 -*-import serial filename='yjy.txt' t = serial.Serial('COM5',57600)b=t.read(3)vaul=[]i=0y=0p=0while b[0]!=170 or b[1]!=170 or b[2]!=4: b=t.read(3) print(b)if b[...原创 2018-05-02 16:12:28 · 4587 阅读 · 6 评论 -
python matplotlib数据可视
matplotlib 是是一个数学绘图库,我们可以使用它来进行数据可视化。绘制简单的折线图import matplotlib.pyplot as plts=[1,5,7,9]plt.plot(s)plt.show()修改标签文字和线条粗细plt.title("Squares Number",fontsize=24)plt.xlabel("Value",fontsize=14)plt.y...原创 2018-05-02 19:45:10 · 283 阅读 · 0 评论 -
利用python进行有道翻译
# -*- coding: UTF-8 -*-from urllib import requestfrom urllib import parseimport jsondef youdao(English): Request_URL='http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule'...原创 2018-05-03 20:41:10 · 1127 阅读 · 2 评论 -
用python爬取笔趣阁小说
# -*- coding: UTF-8 -*-from bs4 import BeautifulSoupfrom urllib import requestif __name__=='__main__': file = open('一念永恒.txt', 'w', encoding='utf-8') yinianyonghen_url="http://www.biqukan.c...原创 2018-05-10 18:55:38 · 1388 阅读 · 0 评论 -
python 将py文件转化为exe
1. 在windows的命令行中输入 pip install pyinstaller 2下载好pyinstaller后,在命令行中输入 pyinsta -F py文件所在的路径3在转化完后,你可在命令行找到一行 Appending archive to EXE ...(路径),后面加的路径即为所生成的exe文件保存路径...原创 2018-06-10 13:05:09 · 918 阅读 · 0 评论 -
python print输出后面为什么会跟一个None
因为python中print函数需要返回值,如果你在print函数中所放的函数没有返回值,那么print将会return None原创 2018-06-10 13:09:29 · 13152 阅读 · 0 评论