Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygame in MacOS Catalina
#1
Hi, not sure of this is in the right place, so bear with me.

I have installed Python 3.8.3 on my Macbook Air running MacOS Catalina and installed pygame using pip3 install pygame --pre

I can run python -m pygame.examples.aliens and it seems to work ok, I can move the cannon and shoot at the aliens.

I am using Rob Miles book "Begin to Code with Python" to learn Python and he has written a library called snaps that utilises pygame functions to manage windows - one of the examples displays a prompt in a gui based window on the screen and is supposed to accept keyboard input. When I run it, the window and the prompt is displayed but the keyboard input doesn't seem to be accepted and I have to force quit it.

Any ideas would be great

(Jul-06-2020, 04:50 AM)ScottB Wrote: Hi, not sure of this is in the right place, so bear with me.

I have installed Python 3.8.3 on my Macbook Air running MacOS Catalina and installed pygame using pip3 install pygame --pre

I can run python -m pygame.examples.aliens and it seems to work ok, I can move the cannon and shoot at the aliens.

I am using Rob Miles book "Begin to Code with Python" to learn Python and he has written a library called snaps that utilises pygame functions to manage windows - one of the examples displays a prompt in a gui based window on the screen and is supposed to accept keyboard input. When I run it, the window and the prompt is displayed but the keyboard input doesn't seem to be accepted and I have to force quit it.

Any ideas would be great

Hmmm, I've just tested it on a Windows machine with the same result - looks like it might be an issue with the snaps library - I might try to contact Microsoft Press and see if they can assist - wish me luck :)
Reply
#2
Sound is missing a direct result of a little bug in examples.aliens presented during refactoring around 5 months back. Bug is just in model not in the library itself. In the event that you are bold and inquisitive enough, you can attempt to discover aliens.py document in models organizer on your neighborhood machine (make certain to find right one, for example include some custom print before all else to be certain you are altering the record you are really running. In the earliest reference point of the fundamental strategy (in my variant it is on lines number 245-248) locate the accompanying code, and simply erase or remark out the second line with pg.mixer = None (the line outside the if square). You are good to go. I make them take a shot at os x catalina (10.15.3) with python 3.8 (additionally works fine with python 3.6 and 3.7)
Reply
#3
(Jul-06-2020, 04:50 AM)ScottB Wrote: Hi, not sure of this is in the right place, so bear with me.

I have installed Python 3.8.3 on my Macbook Air running MacOS Catalina and installed pygame using pip3 install pygame --pre

I can run python -m pygame.examples.aliens and it seems to work ok, I can move the cannon and shoot at the aliens.

I am using Rob Miles book "Begin to Code with Python" to learn Python and he has written a library called snaps that utilises pygame functions to manage windows - one of the examples displays a prompt in a gui based window on the screen and is supposed to accept keyboard input. When I run it, the window and the prompt is displayed but the keyboard input doesn't seem to be accepted and I have to force quit it.

Any ideas would be great

(Jul-06-2020, 04:50 AM)ScottB Wrote: Hi, not sure of this is in the right place, so bear with me.

I have installed Python 3.8.3 on my Macbook Air running MacOS Catalina and installed pygame using pip3 install pygame --pre

I can run python -m pygame.examples.aliens and it seems to work ok, I can move the cannon and shoot at the aliens.

I am using Rob Miles book "Begin to Code with Python" to learn Python and he has written a library called snaps that utilises pygame functions to manage windows - one of the examples displays a prompt in a gui based window on the screen and is supposed to accept keyboard input. When I run it, the window and the prompt is displayed but the keyboard input doesn't seem to be accepted and I have to force quit it.

Any ideas would be great

Hmmm, I've just tested it on a Windows machine with the same result - looks like it might be an issue with the snaps library - I might try to contact Microsoft Press and see if they can assist - wish me luck :)
Either you need to install GCC showhoe so pip can compile pygame.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020