[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] image window disappears



Well, the program was done so it quit.

You need an event loop that keeps looping until you hit the quit button.

http://programarcadegames.com/python_examples/f.php?file=simple_graphics_demo.py


Paul Vincent Craven

On Fri, Jun 12, 2015 at 6:51 PM, tom arnall <kloro2006@xxxxxxxxx> wrote:
Greetings,

The following creates a window on my screen, which disappears after
about 1 second:

import pygame, sys
from pygame.locals import *

# set up pygame
pygame.init()

# set up the window
windowSurface = pygame.display.set_mode((500, 400), 0, 32)
pygame.display.set_caption('Hello world!')



I've tried it with two setups with the same result: python2.7 and python3.4.

Before I put 3.4 on my system, it ran on python2.7 with what I expect
is the correct behavior, i.e., the image persisted until I killed
python. After installing 3.4 and pygame for 3.4, the current problem
emerged.

My OS is Debian Wheezy.

Thanks in advance for any help you can give me,

Tom Arnall

--
Faced with the possibility of its extinction, every species finds
within itself powers unimaginable in the days of its complacency.