简体   繁体   English

尝试运行 python 的乌龟模块时 MacBook Pro 崩溃

[英]MacBook Pro Crash when trying to run python's turtle module

I tried to execute a python program via terminal, and it restarted my MacBook.我试图通过终端执行一个 python 程序,它重新启动了我的 MacBook。

And I tried to find out what the cause was, so I executed Python programs, and this is the result;我试图找出原因,所以我执行了Python程序,这就是结果;

  • It restarts only when the program involves turtle module in Python仅当程序涉及Python中的turtle模块时才重新启动
  • It only restarts when I execute it in terminal via the Python ().py command,只有当我通过 Python ().py 命令在终端中执行它时它才会重新启动,
  • It doesn't restart when executed in IDLEIDLE 中执行时不会重新启动
  • It sometimes makes the screen smaller (which I can't reproduce any more, and seemed very random) (Ask me if you want more detail)它有时会使屏幕变小(我无法再重现,而且看起来很随机)(问我是否需要更多细节)
  • I'm on macOS v10.15.3 (Catalina)我使用的是macOS v10.15.3 (Catalina)
  • I'm using Sublime Text as the text editor我使用Sublime Text作为文本编辑器
  • pip --version → pip 20.0.2 pip --version → pip 20.0.2

Also this popped up once:这也弹出一次:

2020-03-16 22:32:47.640 python[32453:105648] CGSTrackingRegionSetIsEnabled returned CG error 268435459

(I searched in the Internet, but I only found Tkinter cases, so I think this bug is related with window opening in Python?) (我在网上查了一下,找到了Tkinter的案例,所以我觉得这个bug和Python中的窗口打开有关?)

It restarts every single time when I execute the turtle program in Python.当我在 Python 中执行乌龟程序时,它每次都会重新启动。 How do I fix this bug?我该如何修复这个错误?

Turtle uses graphics.龟使用图形。 Maybe due to low graphic resolution, your machine is crashing.可能由于图形分辨率低,您的机器崩溃了。

  1. Change your performance from low -to- high.改变你的表现从低到高。
  2. Change the power option from saving to performance.将电源选项从保存更改为性能。
  3. Clear the background processes清除后台进程
  4. Last, but not least, check your machine cooling, may this works.最后但并非最不重要的是,检查您的机器冷却,这可能有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM