python调webservice和COM接口

调webservice

# -*- coding: cp936 -*-

from suds.client import Client
url = 'http://192.168.50.165/portal/remoting/ERMClientService?wsdl'
client = Client(url)
print client
proxy = client.service
result = proxy.getUserByUserName('admin').encode('gbk')
print result

 

调COM

from win32com.client import Dispatch
fm = Dispatch("PeraFileManage.FileManage")
#fm.SaveFile("d:\\123.txt", "asdfadsfa")
#print(fm.SelectFile())
print(fm.SelectDir())

 

posted @ 2014-11-26 15:58  fatterbetter  阅读(342)  评论(0编辑  收藏  举报