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

[pygame] pygame, py2exe and parachute error



I am currently working with python 2.3, pygame 1.6, and
py2exe 0.5.3.  I am "compiling" everything on windows 2000
for windows 2000 systems.

Everything runs fine using just python 2.3.  The problems
occur when the source is "compiled" using py2exe.

I've tried various examples and the program crashes at the
same point each time, when the "display.set_mode" is called.

Does anyone know why this is happening?  Also does anyone
know how to trace this kind of error?  I've tried various
pygame examples and the same problem occurs, always with
the set_mode command.
Thanks in advance....
----------------
Here is the error:

Fatal Python error: (pygame parachute) Segmentation Fault
abnormal program termination.
---------------
Here is the original source (liquid.py):

import pygame, os
from pygame.locals import *
from math import sin


#initialize and setup screen
pygame.init()
screen = pygame.display.set_mode((640, 480), HWSURFACE|DOUBLEBUF, 8)

#load image
imagename = os.path.join('data', 'liquid.bmp')
bitmap = pygame.image.load(imagename)

#get the image and screen in the same format
if screen.get_bitsize() == 8:
    screen.set_palette(bitmap.get_palette())
else:
    bitmap = bitmap.convert()

#prep some variables
anim = 0.0

#mainloop
while not pygame.event.peek([QUIT, KEYDOWN, MOUSEBUTTONDOWN]):
    anim = anim + 0.4
    for x in range(0, 640, 20):
        for y in range(0, 480, 20):
            xpos = (x + (sin(anim + x * .01) * 15)) + 20
            ypos = (y + (sin(anim + y * .01) * 15)) + 20
            screen.blit(bitmap, (x, y), (xpos, ypos, 20, 20))
    pygame.display.flip()


-------------
here is the py2exe code:

from distutils.core import setup
import py2exe
import pygame

setup(

    # targets to build
    console = ["liquid.py"],
    )


---------------------------------------------------
IMP Webmail brought to you by Galaxy Networks, Inc.
http://www.galaxy.net