如何关闭在执行与PIL相关的python代码期间创建的窗口?

时间:2019-05-30 15:53:04

标签: python python-3.x python-imaging-library raspberry-pi3

我一直在使用python代码在rpi上使用Pillow模块。 我要显示图像,请稍等片刻,然后关闭图像。我使用的代码会打开一个窗口,上面显示图像,这是我需要在打开第二秒后关闭的窗口...

在提供代码之前,我已在rpi上使用终端安装了以下文件,仅供记录

sudo pip3 install Pillow

我的代码是:

from PIL import Image
import time


Img=Image.open("A.PNG") #A.PNG is the Image name
Img.show #Showing Image
time.sleep(1) #Wait for 1 second
##Here I need to close the window which has

图片已打开

如何使用此代码或可能使用任何其他选项。希望您能得到我想要的代码,通过解决上述问题或通过其他方法,可以解决问题的任何事物都会受到赞赏。

0 个答案:

没有答案