when exiting the pygame it always crash

i am try to play a movie using the pygame module

but it always crashes on idle and blender when exiting here’s my script

import pygame
import sys
from pygame.movie import *
from pygame.surface import *

try :
    playing = playing
except :
    playing = 1
    
if __name__ == '__main__':
    pygame.init()
    m = Movie('C:\Bl.mpeg')
    s = pygame.display.set_mode(m.get_size())
    m.set_display(s)
    m.play()
    while playing == 1:
        event = pygame.event.wait()
        if event.type == KEYDOWN :
            playing = 0
            sys.exit()

how can i fix the crash

ok maybe my question is too dumb … lets change the question

have anybody used the pygame to play a movie on blender in real time

  1. how is it done ?

  2. if there are any example i will be thankful

thz

Have you seen this?

http://www.pygame.org/docs/ref/Movie.html

%<

Thz for the replay

yes i have seen that tut from the pygame web actually i downloaded all the tut from the web

but my problem is i can’t get any input from the user when the pygame movie player is running

so how can the movie be canceled when run ??? …for now i set a timer and when it is time the movie will be canceled

I don’t know anything about Python so I can’t help but maybe you could ask at one of the links on this page:

http://www.pygame.org

%<