通过串行接口将HPGLFile从python(不带芯片)发送到古代HP绘图仪

2024-09-29 17:18:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我很难让chiplotle和python3一起运行。有没有一种简单的方式发送情节? plot_hpgl_file是我打算从chiplotle使用的全部。我的绘图仪是一台古老的HP 7575A,我使用的是USB串行转换器


Tags: plot方式python3fileusbhp绘图仪情节
1条回答
网友
1楼 · 发布于 2024-09-29 17:18:07

绘图仪使用RTSCT,以下功能适用于我:

import serial
if __name__ == "__main__":
    file="test.hpgl"
    with open(file, 'r') as content_file:
        content = content_file.read()
    ser = serial.Serial('COM10', 9600, bytesize=8, parity='N', stopbits=serial.STOPBITS_TWO,
                        timeout=5, xonxoff=False, rtscts=True)
    ser.write(content.encode())
    ser.flush()
    ser.close()

相关问题 更多 >

    热门问题