我遇到了一个问题,因为在我的Python代码中os.system(filePath)
将执行,但代码将停止,直到我手动关闭打开的PDF文件的窗口。你知道吗
我想打开一个PDF文件使用openCV来捕获我的屏幕从而捕获文件的图像。如果代码没有在我关闭窗口的情况下运行,这将成为一个问题。。。你知道吗
代码:
import numpy as np
import shutil,os, cv2, SendKeys, win32com.client
#While our In File has stuff in it
while(os.listdir(pathForInFile)!=[]):
for subdir, dirs, inFile in os.walk(pathForInFile):
for fileName in inFile:
filePath= subdir+os.sep+fileName
os.system(filePath)
print "THIS WILL RUN NOT UNTIL I CLOSE FILE"
shell.SendKeys('{DOWN}')
您可以在Windows 8.1(在虚拟机中测试)上使用此解决方案:
和Ubuntu(14.04.4 LTS):
相关问题 更多 >
编程相关推荐