PIL的Image.show()带来了*两个*不同的观看者 [英] PIL's Image.show() brings up *two* different viewers

查看:80
本文介绍了PIL的Image.show()带来了*两个*不同的观看者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在python外壳中处理图像时,我使用image.show(),其中image是Image的实例.很久以前,什么都没发生,但是在定义了名为"xv"的海市rage楼的符号链接后,我感到很高兴.

When toying with images in the python shell, I use image.show(), where image is an instance of Image. Long ago nothing happened, but after defining a symlink to mirage named "xv", I was happy.

最近几天,show()将同时显示ImageMagick的显示和Mirage.尚不清楚show()在何处获取有关运行内容的信息.文档没有帮助.如何使其表现并仅显示其认为是xv的内容?

The last few days, show() will bring up both ImageMagick's display and also Mirage. It's not clear where show() gets information on what to run. Documentation wasn't helpful. How to make it behave and bring up only what it thinks is xv?

推荐答案

好吧,一方面,im.show仅用于调试目的,但不能保证能正常工作.

Well, for one thing, im.show is only intended for debugging purpose, it isn't guaranteed to work.

尽管如此,您始终可以查看源代码(打开"pydoc PIL",FILE部分指出模块所在的位置):

Nevertheless, you can always look at the source (open "pydoc PIL", the FILE section points out where a module is located):

在Windows中,PIL将使用开始/等待文件名"

In Windows, PIL will use "start /wait filename"

在Mac中,它使用"open -a/Applications/Preview.app"

In Macs, it uses "open -a /Applications/Preview.app"

,在Linux上,如果找到则显示"display",否则以"xdg-open"显示.

and on Linux, either 'display' if found or otherwise 'xdg-open'.

这篇关于PIL的Image.show()带来了*两个*不同的观看者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆