该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
菜鸟求助,请各位帮忙看看,我按照书上的提示写了几行,但是老是报错。picture这个文件是有的,也和python文件在一个文件夹里,但是还是不行啊~
from graphics import*
def main():
win=GraphWin('a try',900,600)
win.setCoords(0,0,9,6)
a=Image(Point(4.5,3),"picture")
a.draw(win)
main()
Traceback (most recent call last):
File "C:\Users\dell\Desktop\新建文件夹\2011.11.28.py", line 7, in
main()
File "C:\Users\dell\Desktop\新建文件夹\2011.11.28.py", line 5, in main
a=Image(Point(4.5,3),"picture")
File "C:\Python26\lib\site-packages\graphics.py", line 768, in __init__
self.img = tk.PhotoImage(file=pixmap[0], master=_root)
File "C:\Python26\lib\lib-tk\Tkinter.py", line 3285, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "C:\Python26\lib\lib-tk\Tkinter.py", line 3241, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
TclError: couldn't open "picture": no such file or directory