当前位置: 首页>>代码示例>>Python>>正文


Python Dispatch.execute方法代码示例

本文整理汇总了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'
开发者ID:Excalibur5208,项目名称:ECEN-689-machine_learning,代码行数:18,代码来源:python_matlab.py

示例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
开发者ID:Excalibur5208,项目名称:ECEN-689-machine_learning,代码行数:20,代码来源:python_matlab.py

示例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()
开发者ID:Excalibur5208,项目名称:ECEN-689-machine_learning,代码行数:21,代码来源:python_matlab.py

示例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()")
开发者ID:huxiaoqiang,项目名称:DBGCWebapp,代码行数:5,代码来源:pythonUseMatlab.py


注:本文中的win32com.client.Dispatch.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。