引入了一个非标准的库,media
执行最后一代命令时报错了
import media
f = media.choose_file ()
pic = media.load_picture (f)
media.show(pic)
报错信息如下:
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
media.show(pic)
File "C:Python27libsite-packagespygraphicsmedia.py", line 76, in show
pic.show()
File "C:Python27libsite-packagespygraphicspicture.py", line 168, in show
self._draw_image_to_win(self.win)
File "C:Python27libsite-packagespygraphicspicture.py", line 154, in _draw_image_to_win
ImageTk.PhotoImage(self.get_image()))
File "C:Python27libsite-packagesPILImageTk.py", line 113, in __init__
self.__photo = apply(Tkinter.PhotoImage, (), kw)
File "C:Python27liblib-tkTkinter.py", line 3306, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "C:Python27liblib-tkTkinter.py", line 3262, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
TclError: out of stack space (infinite loop?)
由于以后还要经常用到media这个库,所以很想解决这个问题。 Google了很多,不少人都在求解答