Python 调用DLL操作抄表机
程序员文章站
2022-04-28 10:38:16
# -*- coding: gbk -*- from ctypes import * dll = windll.loadlibrary('jba188.dll') a =...
# -*- coding: gbk -*-
from ctypes import *
dll = windll.loadlibrary('jba188.dll')
a = dll.test()
print '测试设备连接状态%s' % a
srcname = c_char_p("publish_pd.bin")
decname = c_char_p('d:\\publish_pd.bin')
b = dll.upfile(srcname,decname)
print '将文件上传至计算机%s' % b
pstr = c_char_p()
pstr.value = ''
c = dll.getdatetime(pstr);
print '读取抄表机时间%s' % c
print pst
from ctypes import *
dll = windll.loadlibrary('jba188.dll')
a = dll.test()
print '测试设备连接状态%s' % a
srcname = c_char_p("publish_pd.bin")
decname = c_char_p('d:\\publish_pd.bin')
b = dll.upfile(srcname,decname)
print '将文件上传至计算机%s' % b
pstr = c_char_p()
pstr.value = ''
c = dll.getdatetime(pstr);
print '读取抄表机时间%s' % c
print pst
上一篇: python3.0 字典key排序
下一篇: PHP运算符