欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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