当前位置:网站首页>1313_pyserial的安装以及文档的生成
1313_pyserial的安装以及文档的生成
2022-07-28 01:14:00 【grey_csdn】
串口应该算是一个很有历史的技术了,在嵌入式的领域中应该有着极其广泛的应用。由于我自己工作的特殊性,从事了汽车电子,前几年的开发又是接触的别人的相对成熟的软硬件开发平台,因此这方面在工作的过程中就基本上没有用到。我真正觉得串口是一个好东西的时候其实是在我玩我的Arduino的时候,发现这种方式还是非常直接干脆的。
近段时间,串口在我做软件调试的时候给了我很大的帮助。但是,我觉得这个还是欠缺了点什么,主要的欠缺点应该就是没有Arduino那样的便捷。或许,我应该找一个上位机的东西,把我的调试以及测试串成块。这样,找一个python脚本支持的串口收发方案就成了我的首选。我找到了: pyserial/pyserial: Python serial port access library (github.com)

首先就是安装, pip install pyserial就可以了。这一个安装相对来说简单,在下载下来的repo压缩包中还有一个文档需要自己做生成。

文档位于上面的目录中,已经有写好的Makefile可以直接进行make生成。不过,在生成的时候需要安装一个文档生成工具。工具就是基于python实现的Sphinx。我第一次尝试安装的时候,可能网络质量很差,一直失败。后来,启用了我之前一直用的一个小脚本。

这是包管理的小脚本,具体的代码可以参考文章最后。现在看上去,似乎网络质量有了一定的改善。第一次安装基本都有快要成功的感觉了。
文档管理工具安装成功之后,可以切换到documentation目录下面,执行make html来生成html的文档。如果在windows的环境下执行,得注意需要有bash命令环境支持。以下是一个执行的效果:

如果要生成pdf,可以借助于latex。这样,输入make latex就可以生成。我的电脑WSL中配置了latex的环境,这里尝试生成一下pdf文档。还是在上面的目录,输入make latex。

执行结束,会有类似的提示。可能中间有一些警告,但是看到最后的生成成功,暂且不去管了。接下来,切换到latex配置文件的目录下继续生成pdf。

这样,就生成了pdf文档。

以上,是生成的文档的结果。
这一次的时间有点赶,时间不早了也该休息了。暂且做这个工具的安装以及文档生成的记录,后面的调试再说。
附加信息以及代码:
python包的强制安装:
#!/usr/bin/python
import os
def SmartInstall(lib_name):
installed_flg = False
num = int(1)
while installed_flg == False:
print("the %dth time try to install %s" % (num, lib_name))
num = int(num + 1)
try:
exec('import ' + lib_name)
installed_flg = True
except:
os.system("pip install -U %s" % lib_name)
SmartInstall('sphinx')
边栏推荐
- Lombok prompts variable log error when using JUnit test in idea
- 数字赋能 创新未来:海丝埃睿迪亮相第五届数字中国建设峰会
- Two ways for wechat applet to realize dynamic horizontal step bar
- Get the difference data of two sets
- APP如何上架App Store?
- Ceresdao: new endorsement of ventures Dao
- Unittest unit test framework full stack knowledge
- QT implementation disable shortcut key
- 剑指offer专项突击版第12天
- Pytorch optimizer settings
猜你喜欢

Leetcode hot topic Hot 100 - > 2. Add two numbers

QGIS mapping: vector data mapping process and export

MySQL锁系列之锁算法详解(荣耀典藏版)

Use of Day6 functions and modules

Codeworks round 807 (Div. 2) a-c problem solution

Promise from getting started to mastering (Chapter 3: customize (handwriting) promise)

作业7.27 IO进程

软考 --- 数据库(2)关系模型

【ROS进阶篇】第十讲 基于Gazebo的URDF集成仿真流程及实例
![[understanding of opportunity -53]: Yang Mou stands up and plots to defend himself](/img/93/2f61993770d93d9adc80a9fa89e71c.jpg)
[understanding of opportunity -53]: Yang Mou stands up and plots to defend himself
随机推荐
AWS elastic three swordsman
cn+dt
Two ways for wechat applet to realize dynamic horizontal step bar
How MySQL uses indexes (glory Collection Edition)
Eredi reappeared at the digital China Summit and continued to deepen the protection of green waters and mountains with science and technology
Class notes (5) (1) - 593. Binary search
Sqlserver problem solving: replication components are not installed on this server. Please run SQL Server Setup again and select the option to install replication components
小程序毕设作品之微信校园维修报修小程序毕业设计成品(4)开题报告
Synchronized details
产品解读丨MeterSphere UI测试模块的设计与分布式扩展
埃睿迪再度亮相数字中国峰会 持续深化用科技守护绿水青山
Skywalking distributed system application performance monitoring tool - medium
Use try-with-resources or close this
pytorch优化器设置
小程序毕设作品之微信校园浴室预约小程序毕业设计成品(3)后台功能
Wechat campus maintenance and repair applet graduation design finished product of applet completion work (4) opening report
了解加密行业的“下一个大趋势”——Ventures DAO
MySQL high availability and master-slave synchronization
Three core issues of concurrent programming (glory Collection Edition)
mysql: error while loading shared libraries: libtinfo.so. 5 solutions