请教python调用dll动态库的传参问题
2个回答
展开全部
不知道你具体是什么问题,下面是python调用win msgbox 和shellexec的方法,可以参考一下:
import ctypes
#win api shellexecuteapiA and msgboxA
def execute(path):
handler = None
operator = "open"
fpath = path
param = None
dirpath = None
ncmd = 1
shell32 = ctypes.windll.LoadLibrary("shell32.dll")
shell32.ShellExecuteA(handler,operator,fpath,param,dirpath,ncmd)
def msgbox(msg='mesage'):
user32 = ctypes.windll.LoadLibrary('user32.dll')
user32.MessageBoxA(0, msg.decode('utf8').encode('gbk'), 'aaaaaaa',0)
if __name__ == '__main__':
execute('config.ini')
msgbox('aaaaaa')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询