Python乌龟模块导致OS X崩溃 [英] Python turtle module causes OS X to crash

查看:103
本文介绍了Python乌龟模块导致OS X崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究思考Python 第4章,他们告诉您键入以下内容看看您是否有turtle模块:

I'm working through Think Python chapter 4, where they tell you to type the following to see if you have the turtle module:

import turtle
bob = turtle.Turtle()

这应该打开一个新窗口,但是,它使我的计算机崩溃了.我已经看到它冻结了我的计算机,使我无法移动光标或更改窗口,因此必须重新启动它.而且我也看到它关闭了我所有的程序,然后重新打开它们.

This is supposed to open a new window, but instead, it crashes my computer. I've seen it freeze my computer where I can't move the cursor or change windows, and I have to restart it. And I've also seen it close all my programs and re-open them.

我正在运行从Mosve版本10.14.6的Macbook Air上从Anaconda下载的Python 3.7.

I'm running Python 3.7 downloaded from Anaconda on a Macbook Air with Mojave version 10.14.6.

当我在下面运行BenajahTX的建议时,我得到此错误消息打印了16次: CGSTrackingRegionSetIsEnabled returned CG error 268435459

When I run BenajahTX's suggestion below, I get this error message printed 16 times: CGSTrackingRegionSetIsEnabled returned CG error 268435459

有什么线索导致此问题或如何解决?

Any clue what is causing this or how to fix it?

推荐答案

尝试使用以下命令在终端中运行文件: $ python filename.py

Try running the file in the terminal using the command:- $ python filename.py

我遇到了同样的问题,我是VS代码扩展Code Runner来运行python文件,但是,当我尝试在终端上运行时,mac OS这次没有崩溃

I had the same issue and I was VS code extension Code Runner to run the python file, however, when I tried the terminal it worked and the mac OS was not crashing this time

这篇关于Python乌龟模块导致OS X崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆