[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] refresh problem
pistacchio wrote:
Lenard Lindstrom ha scritto:
The IDLE problem isn't really a problem as such. Being an
interactive session, the interpreter doesn't shut down when the
Pygame code finishes. So pygame.quit is not called and the window
remains visible. Restarting the interpreter or adding an explicit
pygame.quit() closes the window. As for the OPs example code, I put
it in a file and double-clicked. Worked fine.
oh, thanks, this helped a lot. would the situation change with a
different ide? any suggestion? (again, i'm working under windows xp)
this thing that i have to work around the problem every time that the
program rises an error or an exception it is quite boring as, like you
made me understand, the cycle doesn't come to the point where it quits
all the processes and hence pygame and i have to wait, termnate it
and, in a word, lose 30 seconds every time i want to change a comma in
the code.
This works with IDLE in both single and subprocessed mode:
import pygame
from pygame.locals import *
pygame.init()
try:
screen = pygame.display.set_mode( (640,480) )
done = False
while not done:
pygame.display.flip()
for event in pygame.event.get():
if event.type == QUIT:
done = True
finally:
pygame.quit()
In single process mode it will lock up the editor, but frees it when the
window Pygame window closes.
--
Lenard Lindstrom
<len-l@xxxxxxxxx>