标签:path write txt port com serial win32com win32 pat
# -*- coding: utf-8 -*-
import os
import win32com.client
import time
import serial
dm = win32com.client.Dispatch(‘dm.dmsoft‘)
#current version
dm.SetPath("E:\dm\haha")
dm.SetDict(0,"E:\dm\haha\dm_soft.txt")
dm.useDict(0)
com3=serial.Serial(‘com3‘,57600)
string=‘[MM11]‘
#转成16进制
i=1000
while (i!=0):
i=i-1
com3.write(string.encode("utf8"))
标签:path write txt port com serial win32com win32 pat
原文地址:https://www.cnblogs.com/sunjian0564/p/9432142.html