【发布时间】:2011-07-17 16:08:32
【问题描述】:
我有几张图片想用 Python 向用户展示。用户应该输入一些描述,然后应该显示下一个图像。
这是我的代码:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os, glob
from PIL import Image
path = '/home/moose/my/path/'
for infile in glob.glob( os.path.join(path, '*.png') ):
im = Image.open(infile)
im.show()
value = raw_input("Description: ")
# store and do some other stuff. Now the image-window should get closed
它正在工作,但用户必须自己关闭图像。输入描述后我可以让python关闭图像吗?
我不需要 PIL。如果您对另一个库/bash 程序(带有子进程)有其他想法,也可以。
【问题讨论】:
标签: python python-imaging-library