HACKER
TALK
Home
Channels
beta
Bookmarks
Messages
Notifications
Sign In
Comment
Whisper
python监听串口,将数据存入数据库出错
有一个小需求,要将串口的数据存入数据库,找了个python程序,并使用虚拟串口发送数据到相应串口,但是python接收时好像出了问题,代码如下,虚拟串口模拟发送数据:12345678918765567
HD Superman
HD Superman
·3 years ago
Across the Great Wall, we can reach every corner in the world.

似乎提醒你这里错了 ⬇️:

td = int(data[4:6])
hd = int(data[6:8])

see: ValueError: invalid literal for int() with base 10: ''

Replies
HD Superman
HD Superman
Joined 4 years ago
Across the Great Wall, we can reach every corner in the world.
github.com/hdsuperman
Message
Terms of ServicePrivacy PolicyCookie PolicyMarkdown SyntaxUser PointsUser Feedback© 2025 Shware Inc.