python - 为什么我两次调用此函数时会出现错误
问题描述
我第一次调用函数时它可以工作,但第二次调用该函数时出现此错误:
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
return self.func(*args)
File "/Users/larasinnott/Desktop/Katie/Katie Sinnott - Compter Science - Coursework-2.py", line 6751, in <lambda>
command=lambda: [root154.destroy(), firework(),
File "/Users/larasinnott/Desktop/Katie/Katie Sinnott - Compter Science - Coursework-2.py", line 6812, in firework
bot = turtle.Turtle()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/turtle.py", line 3816, in __init__
visible=visible)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/turtle.py", line 2557, in __init__
self._update()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/turtle.py", line 2660, in _update
self._update_data()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/turtle.py", line 2646, in _update_data
self.screen._incrementudc()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/turtle.py", line 1292, in _incrementudc
raise Terminator
turtle.Terminator
如果有帮助的话,我已经导入了 Tkinter、pygame、turtle 和 random。有任何想法吗?x 谢谢
解决方案
推荐阅读
- jquery - 如果其中一个字段多选,如何将 html 表单转换为休息控制器的 ajax 请求?
- c# - 通过 RS232 读取称重数据
- regex - 如何删除字符串变量(Stata)中除某些单词之外的所有内容?
- javascript - Node.js 中的事件处理程序内部的异步等待
- docker - 从 docker 容器、使用 NGINX 和反向代理的主机发送邮件
- javascript - 有效的 JWT 对 nestJS 守卫无效
- python-3.x - tf.while_loop InvalidArgumentError 的问题:使用输入昏暗 0 的索引超出范围;输入只有 0 个暗淡 [Op:StridedSlice] 名称:strided_slice/
- windows-10 - 无法关闭 Twain 源
- python - 为什么我的神经网络的输入 pickle 文件是 19GB?
- rstudio - 如何解决 RStudio 中的访问被拒绝错误?