Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pygame keeps quitting
#1
My pygame keeps quitting unexpectedly, please help
Here is my code:

import pygame
pygame.init()

windowSize = [400, 300]
screen = pygame.display.set_mode(windowSize)
colour = pygame.color.Color('#0A32F4')

done = False
while not done:
    pygame.draw.rect(screen, colour, [10, 20, 30, 40])
    pygame.display.flip()
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True
pygame.quit()
Reply
#2
what do you mean by unexpectedly?
Recommended Tutorials:
Reply
#3
A tab opens up and says "Pygame exit unexpectedly," not sure what to do. Just got pygame to work.

Exact message

Quote:Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple.
Reply
#4
What version of python and pygame are you using ?
import sys, pygame
print(pygame.version)
print(sys.version)
Curious. Try adding a clock or delay.
# after pygame.display.flip()
pygame.time.delay(10)
or
clock = pygame.time.Clock()
# after pygame.display.flip()
clock.tick(30)
99 percent of computer problems exists between chair and keyboard.
Reply
#5
i can say ive heard a lot of problems from users of Mac and Pygame. Anything from them having to do things such as downgrading El Captain's version sdl_image from 1.2.12 down to 1.2.10 due to a bug.

I dont know what mac version you have as i do not have a mac or keep up with their stuff. But there seems to always be an issue with macs.

Now having said that. You could of easily installed the wrong version. If your using the python2.7-32 from the other thread then i would suggest to look for a wheel of pygame for that version here
https://pypi.python.org/pypi/Pygame
I dont know if those listed for macosx are for 32 bit or 64, but you can try those.

If you have installed every possible one for mac than and still not succeed, i would put up an issue at pygame for help from them
https://github.com/pygame/pygame/issues

You can also search out previously issues with mac by searching out mac issues to see if someone says the same issue
https://github.com/pygame/pygame/issues?...C%93&q=mac
Recommended Tutorials:
Reply


Forum Jump:

User Panel Messages

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