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

从Python控制台显示.jpg或.gif图像的最简单方法是什么?

I've got a Python console program that is checking a data set which contains links to images stored locally. How should I write the script so that it would display images pop-up graphical windows?

我有一个Python控制台程序正在检查一个数据集,其中包含本地存储的图像的链接。我应该如何编写脚本以便显示图像弹出图形窗口?

9 个解决方案

#1


42

Using the awesome Pillow library:

使用令人敬畏的枕头库:

>>> from PIL import Image                                                                                
>>> img = Image.open('test.png')
>>> img.show() 

This will open the image in your default image viewer.

这将在默认图像查看器中打开图像。

更多相关文章

  1. Python为8bit深度图像应用color map
  2. Tensorflow:恢复图形和模型,然后在单个图像上运行评估
  3. python的PIL绘制多行文本的图像。
  4. 铯:使用自己的OpenStreetMap服务器。:“未能获得图像块”错误
  5. 如何将图像加载到PictureBox;基于存储在DataBase中的图像位置
  6. 使用进度条延迟加载图像会使图像在显示时发生损坏
  7. Android 修改用户图像笔记
  8. 背景图像颜色检测与Android油漆。
  9. 想在android中使用node.js和socket.io发送图像

随机推荐

  1. Android的MediaPlayer架构介绍
  2. android 入门之二【android 体系架构】
  3. 【Android 开发】:通知之Notifications To
  4. handler机制
  5. android界面设计之shape的使用
  6. 在 Android 上使用 XML
  7. Android RelativeLayout属性大全(中文解释
  8. [Android 新特性] 谷歌发布Android Studi
  9. 收藏了4年的Android 源码分享
  10. Android(安卓)ApiDemos示例解析(150):Vie