Python Turtle Crashes MacOS - python-3.x

Yes, I know there are already questions with a similar title, but I couldn't find a solution.
My problem is that whenever I use turtle, it crashes the entire computer. A video is attached here. This works with any turtle command, not just the one shown. It also crashes when I use any interpreter, not just the terminal.
I am running MacOS Mojave 10.14.6, with python 3.7.
Thank you for any help you may have.

Related

Python 3.10 - ModuleNotFoundError: No module named 'win32.win32ui'

I just updated my python from 3.7 to 3.10 and now there are import error's.
While I just needed for import win32gui turn into import win32.win32gui as suggested here. There seems no other syntax for import win32ui, after some research I found this github report that has been closed with:
That's very helpful, thanks, and I can reproduce this in visual studio
I didn't consider that an exception was being caught and ignored. Turns out we aren't holding the GIL when we call back into Python -
I've no idea why this is different in 3.9 vs other versions, but the
fix is simple and is safe in all versions.
While there is suggested to comment out a line in a file named win32control which I apperantly dont have or find. Neither it seems possible in my compiled files that looks like:
G Áàȉ x#;÷щ
Nor do I understand the wheel solution and what to do with it, since I am still a beginner with hobby experience in python programming.
Update I just found this Q&A but not sure if it is related.
While it helped me on my other device to just reinstall my older python version, as stated in the comment section:
#CristiFati thanks for your reply. Since I installed my earlier
version of 3.7.2 again pywin works fine even if I run the code with
IDLE Shell 3.10.
This wasnt possible on my new device, but the Running as a Windows Service helped me out this time.
Manually copy pythonservice.exe from the site-packages/win32 directory
to the same place as these DLLs.

How to get terminal size in Spyder?

I am trying to get the terminal size using the function shutil.get_terminal_size().
This works well in a Python console or an Ipython console, but not in the Ipython console inside the Spyder editor, and I don't understand why.
Any ideas ?
Thanks in advance!
(Spyder maintainer here) Spyder consoles are not "real" consoles, i.e. they are not based on the same technologies as those used in terminal-based consoles (such as cmd.exe or Terminal.app). Therefore, shutil.get_terminal_size() doesn't work as expected.
Actually, our console's width is fixed at 80 characters and right now (October 2020) that limit can't be changed.

How to use processing.py in google colaboratory

Recently I've been studying a lot on the processing library (mainly using p5.js) and was delighted to find out that in the processing IDE, there is a python mode, processing.py.
I want to try using it in google colaboratory. I tried using pip install to install it in colab and in the console it said it was installed successfully but when I try running a script that usually runs in the python mode of the processing IDE, it doesn't work. Below is a screen cap of the code and the error. In the processing IDE, (without the last 2 lines), this will show a 400 x 400 gray canvas with a circle drawn at its center.
I also tried installing java into the colab just in case processing.py requires java. Nothing seems to work though. For those who want to see the entire notebook, here is the link: https://colab.research.google.com/drive/19UVAR2iOWk4NnrHxNhd_XL03MUoKrCF3?usp=sharing It is set so that anyone with the link can open it.
I hope someone can help me with this. Thanks very much.
I'm afraid it is not possible to use https://py.processing.org on Colab, as it is based on the Jython interpreter, a Python 2 that runs on the Java Virtual Machine (the upside of Jython being that we can use most of the librairies created by the Processing Java community, available with a few clicks from the IDE).
You might be able to run this new experimental "Processing in Python 3" project on Colab: https://github.com/p5py/p5
There is a new p5 library in pyPI that can be installed:
!pip install -U p5
import p5
However, I have had problems getting the chart to show. I believe that the problem is getting Colab to write to my display. It would be great if someone could solve this...

catalina: emacs, python and keyboard input (using psychopy)

i'm facing the following problem.
I use python with emacs on a mac with Catalina OS.
I try to get input from the keyboard in my python script (trhough psychopy library). It does not work, and i receive the following message:
HIDBuildMultiDeviceList: Couldn’t open IOHIDManager.PsychHID-ERROR: Could not enumerate and attach to all HID devices (HIDBuildDeviceList(0,0) failed)!
PsychHID-ERROR: One reason could be that some HID devices are already exclusively claimed by some 3rd party device drivers
I have a similar problem when i try to access the microphone. However, it works from within another editor. It seems that the problem is that i'm denied access to the keyboard (and mic) when running a python script.
Any help would be most welcome.
Best
thibault
I was experiencing the same problem, and restarting solved it!
I had code to play audio files and wait for a key on the keyboard to be hit. This code used to work, and then when I made some changes elsewhere in the code I started for the first time to experience this problem. Using the Python debugger in Terminal (python -m pdb myPsychopyCode.py) I tracked it down to occurring in the 2nd of these lines:
from psychopy.hardware import keyboard
kb = keyboard.Keyboard() # Set up a keyboard device
The error occurred replicably, whether I ran from the whole script or used it interactively in the python debugger. My fix was simply to restart! Thereafter the error messages stopped. I don't like this fix because it means I don't know what caused it or when it might happen again.
2017 MacBook Pro, macOS Big Sur 11.4, external LG monitor, bluetooth external Magic Keyboard, bluetooth external Magic Trackpad.

Python code terminated in Pycharm with exit code 1073741819

Python version: 3.4
Hi, I was running a small Python code in Pycharm, but it was terminated with the exit code 1073741819.
I've tried the same code in the Python command line and Anaconda, and both worked. Any idea why Pycharm has the problem, and how can I get it work in Pycharm? Thanks a lot.
Its too late to answer now, but maybe it helps someone else. My code also worked right with command line but not inside pycharm, it usually happens when we switch between different projects on PyCharm.
I fixed it by:
1- Restarting the Pycharm and reloading the project into it.
2- Clearing the heap memory by clicking at this in status bar:
and now it works pretty fine.
P.S: If this indicator doesnt appear then visibility of this section in the Status bar is defined by the Show memory indicator check box in the Appearance page of the Settings/Preferences dialog. It is not shown by default.

Resources