运行图形文件时我不断收到错误代码

发布于 2025-01-11 13:48:06 字数 1161 浏览 0 评论 0原文

对于我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文