[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] pygame newbie



hello all,

i've started to play arround with pygame, and i like it very much.

i got a small example, which doesn't work, as i would expect:

    import pygame
    import pygame.mixer as mixer
    import pygame.music as music
    import pygame.time as time
    import pygame.event as event
    from pygame.locals import *

    mixer.pre_init()
    #pygame.init()

    music.init()
    if not music.get_init():
        raise SystemExit, 'could not initialize music'

    mp3 = music.load('E:/MP3/Basis - Ich Lieb Dich Immer Noch.mp3')
    music.play(0)

    #while not event.peek([KEYDOWN,KEYUP]):
    while music.get_busy(): time.delay(1000)

    #pygame.quit()

well, the example works fine (and plays the desired mp3), but if i uncomment
the commented lines, i don't hear the mp3 anymore and i can't catch the
keyboard. do i need to create a window/surface to be able to achieve this
effect (this is only a command line script).

TIA,
kaweh





____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org