当前位置:网站首页>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')
边栏推荐
- 小程序毕设作品之微信校园浴室预约小程序毕业设计成品(2)小程序功能
- 并发编程的三大核心问题(荣耀典藏版)
- Leetcode hot topic Hot 100 - > 3. longest substring without repeated characters
- Product axure9 English version, using repeater repeater repeater to realize multi-choice and single choice
- 【愚公系列】2022年07月 Tabby集成终端的使用
- What is eplato cast by Plato farm on elephant swap?
- regular expression
- [solution] solve the problem of SSH connection being inactive for a long time and being stuck and disconnected
- Flex layout - fixed positioning + flow layout - main axis alignment - side axis alignment - expansion ratio
- QGIS mapping: vector data mapping process and export
猜你喜欢

C # using ABP warehouse to access the database error record set

Product axure9 English version, using repeater repeater repeater to realize multi-choice and single choice

MySQL是如何利用索引的(荣耀典藏版)

Appium click operation sorting

新零售业态下,零售电商RPA助力重塑增长

Product interpretation - Design and distributed expansion of metersphere UI test module

正则表达式

【愚公系列】2022年07月 Go教学课程 019-循环结构之for

Use of Day6 functions and modules

Ceresdao: new endorsement of ventures Dao
随机推荐
Understand the "next big trend" in the encryption industry - ventures Dao
AWS elastic three swordsman
APP如何上架App Store?
视频常用分辨率
Manual installation of Dlib Library
【ROS进阶篇】第九讲 基于Rviz和Arbotix控制的机器人模型运动
SkyWalking分布式系统应用程序性能监控工具-中
[Yugong series] use of tabby integrated terminal in July 2022
作业7.27 IO进程
ArcGIS: loading historical remote sensing images
pytorch优化器设置
C # using ABP warehouse to access the database error record set
[advanced ROS] Lecture 9 robot model motion based on rviz and arbotix control
How to put app on the app store?
[Yugong series] July 2022 go teaching course 019 - for circular structure
mysql: error while loading shared libraries: libtinfo.so. 5 solutions
MySQL create stored procedure ------ [hy000][1418] this function has none of deterministic, no SQL
Promise从入门到精通(第3章 自定义(手写)Promise)
Lombok prompts variable log error when using JUnit test in idea
LeetCode 热题 HOT 100 -> 3. 无重复字符的最长子串