运行图形文件时我不断收到错误代码
对于我的 comp sci 1 课程,我们需要使用 pycharm 上的graphics.py be Zelle 文件做一个项目。我在运行代码时不断遇到这个问题,并且在没有收到此错误的情况下无法成功完成它:
Traceback (most recent call last):
File "/Users/gabbymacdonald/PycharmProjects/GabrielleMacDonaldProject2/Drawing Shapes.py", line 65, in <module>
main()
File "/Users/gabbymacdonald/PycharmProjects/GabrielleMacDonaldProject2/Drawing Shapes.py", line 22, in main
rect.draw(win)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/graphics.py", line 484, in draw
self.id = self._draw(graphwin, self.config)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/graphics.py", line 614, in _draw
return canvas.create_rectangle(x1,y1,x2,y2,options)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 2835, in create_rectangle
return self._create('rectangle', args, kw)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 2805, in _create
return self.tk.getint(self.tk.call(
_tkinter.TclError: unknown color name "5"'
老实说,我不太确定出了什么问题,我认为这只是一个介绍类,哈哈。
For my comp sci 1 class, we are required to do a project using the graphics.py be Zelle file on pycharm. I keep getting this issue when running my code, and cannot successfully complete it without receiving this error:
Traceback (most recent call last):
File "/Users/gabbymacdonald/PycharmProjects/GabrielleMacDonaldProject2/Drawing Shapes.py", line 65, in <module>
main()
File "/Users/gabbymacdonald/PycharmProjects/GabrielleMacDonaldProject2/Drawing Shapes.py", line 22, in main
rect.draw(win)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/graphics.py", line 484, in draw
self.id = self._draw(graphwin, self.config)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/graphics.py", line 614, in _draw
return canvas.create_rectangle(x1,y1,x2,y2,options)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 2835, in create_rectangle
return self._create('rectangle', args, kw)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 2805, in _create
return self.tk.getint(self.tk.call(
_tkinter.TclError: unknown color name "5"'
I am honestly not quite sure what is going wrong, I thought this was just an intro class lol.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论