简体   繁体   中英

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.

And I tried to find out what the cause was, so I executed Python programs, and this is the result;

  • It restarts only when the program involves turtle module in Python
  • It only restarts when I execute it in terminal via the Python ().py command,
  • It doesn't restart when executed in IDLE
  • 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)
  • I'm using Sublime Text as the text editor
  • 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?)

It restarts every single time when I execute the turtle program in 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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