[Tutor] animations and movies
bhaaluu
bhaaluu at gmail.com
Fri May 9 18:16:27 CEST 2008
On Thu, May 8, 2008 at 9:40 PM, <Nick.Treloar at education.nsw.gov.au> wrote:
> hey just wondering if any one can point me in the right direction for coding
> animations and playing movies
> ________________________________
> This message is intended for the addressee named and may contain privileged
> information or confidential information or both. If you are not the intended
> recipient please delete it and notify the sender.
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
Here's a short pygame example that plays a video.mpg (MPEG 1 file):
#!/usr/bin/python
# movie.py
import sys
import pygame
pygame.init()
mov_name = "video.mpg"
pygame.mouse.set_visible(False)
pygame.mixer.quit()
screen = pygame.display.set_mode((320, 240))
video = pygame.movie.Movie(mov_name)
screen = pygame.display.set_mode(video.get_size())
video.play()
while video.get_busy():
for event in pygame.event.get():
if event.type == pygame.QUIT:
break
Of course, you'll need a file called video.mpg for the script to work.
--
b h a a l u u at g m a i l dot c o m
Kid on Bus: What are you gonna do today, Napoleon?
Napoleon Dynamite: Whatever I feel like I wanna do. Gosh!
More information about the Tutor
mailing list