Showing an image from console in Python

后端 未结 10 627
感动是毒
感动是毒 2020-12-02 20:42

What is the easiest way to show a .jpg or .gif image from Python console?

I\'ve got a Python console program that is checking a data set wh

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 21:11

    Or simply execute the image through the shell, as in

    import subprocess
    subprocess.call([ fname ], shell=True)
    

    and whatever program is installed to handle images will be launched.

提交回复
热议问题