我在实际杀死在查看器中显示图像的子进程时遇到了问题。基本上,我是从堆栈中打开图片,并希望在一定时间内显示它们,然后终止子进程。当运行这个程序时,它显示了想要的图片,但我不能让实际的.kill
或{
class ImageDisplay(ThreadParent):
def __init__(self, label):
ThreadParent.__init__(self, label)
def display_image(self):
image = ThreadParent.image_stack.pop(0)
cwd = os.getcwd()
# Automagically opens in preview @ osx
p = subprocess.Popen(["open", "file://%s/%s" % (cwd,
filepath(filename(image)))])
disptime = displaytime(image)
print("Displaying image:", image, "for", disptime, "seconds..")
time.sleep(disptime)
p.terminate()
p.kill()
我们将非常感谢所有的帮助。在
祝你一切顺利
我认为
open
将在预览打开后终止,这意味着您没有预览程序的句柄。尝试调用预览二进制文件,如下所示:高温
相关问题 更多 >
编程相关推荐