Showing an image from console in Python

后端 未结 10 622
感动是毒
感动是毒 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 20:47

    I made a simple tool that will display an image given a filename or image object or url.
    It's crude, but it'll do in a hurry.

    Installation:

     $ pip install simple-imshow
    

    Usage:

    from simshow import simshow
    simshow('some_local_file.jpg')  # display from local file
    simshow('http://mathandy.com/escher_sphere.png')  # display from url
    

提交回复
热议问题