本文整理汇总了Python中win32com.client.Dispatch.execute方法的典型用法代码示例。如果您正苦于以下问题:Python Dispatch.execute方法的具体用法?Python Dispatch.execute怎么用?Python Dispatch.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32com.client.Dispatch
的用法示例。
在下文中一共展示了Dispatch.execute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: method1
# 需要导入模块: from win32com.client import Dispatch [as 别名]
# 或者: from win32com.client.Dispatch import execute [as 别名]
def method1():
# process the image
img = cv2.imread("img_0.jpg",0)
res = cv2.resize(img,(64, 64), interpolation = cv2.INTER_LINEAR)
cv2.imwrite("D:/mysite/polls/img_1.jpg",res)
# return 'ana'
h = Dispatch("Matlab.application")
h.execute("cd 'D:\mysite\polls';")
h.execute("python_matlab('img_1.jpg');")
result = open('D:/mysite/polls/result.txt')
if int(result.readlines()[0]) == 0:
return 'cat'
else:
return 'dog'
示例2: method1
# 需要导入模块: from win32com.client import Dispatch [as 别名]
# 或者: from win32com.client.Dispatch import execute [as 别名]
def method1():
dir_pre = 'D:/mysite_2/media/'
dir_1 = 'repository/'
dir_2 = 'resize_fig/'
testFileList = listdir(dir_pre + dir_1)
for name in testFileList:
pathIn = dir_pre + dir_1 + name
pathOut = dir_pre + dir_2 + name
resizeFig(pathIn, pathOut)
h = Dispatch("Matlab.application")
h.execute("cd 'D:\\mysite_2\\uploads';")
h.execute("python_matlab('D:\\mysite_2\\media\\resize_fig\\', 'D:\\mysite_2\\media\\result.txt');")
result_file = open(dir_pre + 'result.txt')
result = result_file.readlines()
result_file.close()
return result
示例3: Dispatch
# 需要导入模块: from win32com.client import Dispatch [as 别名]
# 或者: from win32com.client.Dispatch import execute [as 别名]
import cv2
from os import listdir
from win32com.client import Dispatch
# process the image
img = cv2.imread("img_0.jpg",0)
res = cv2.resize(img,(64, 64), interpolation = cv2.INTER_LINEAR)
cv2.imwrite("img_1.jpg",res)
h = Dispatch("Matlab.application")
h.execute("cd 'D:/2014-2016 TAMU/Course/My course/ECEN689 SPECIAL TOPICS IN MACH LEARNING/8. project/1.task';")
h.execute("python_matlab('img_1.jpg');")
result = open('result.txt')
if int(result.readlines()[0]) == 0:
print 'cat'
else:
print 'dog'
result.close()
示例4: Dispatch
# 需要导入模块: from win32com.client import Dispatch [as 别名]
# 或者: from win32com.client.Dispatch import execute [as 别名]
from win32com.client import Dispatch
h = Dispatch("Matlab.application")
h.execute("DBGCUseTrainedANN()")