LINUX.ORG.RU

История изменений

Исправление z00ke, (текущая версия) :

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pygame

FILENAME = '/music/coolmusic.midi'


def main():
    pygame.init()

    pygame.mixer.music.load(FILENAME)
    pygame.mixer.music.play(-1, 0.0)

    while True:
        pass

if __name__ == "__main__":
    main()

Исправление z00ke, :

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pygame

FILENAME = 'res/tetrisc.mid'


def main():
    pygame.init()

    pygame.mixer.music.load(FILENAME)
    pygame.mixer.music.play(-1, 0.0)

    while True:
        pass

if __name__ == "__main__":
    main()

Исправление z00ke, :

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import pygame
from pygame.locals import *

FILENAME = '/music/catXXX.midi'


def main():
    pygame.init()

    pygame.mixer.music.load(FILENAME)
    pygame.mixer.music.play(-1, 0.0)

    while True:
        pass


if __name__ == "__main__":
    main()

Исправление z00ke, :

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import pygame
from pygame.locals import *

DISPLAY = 400, 320
FILENAME = '/music/catXXX.midi'


def main():
    pygame.init()

    pygame.mixer.music.load(FILENAME)
    pygame.mixer.music.play(-1, 0.0)

    while True:
        pass


if __name__ == "__main__":
    main()

Исправление z00ke, :

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import pygame
from pygame.locals import *

DISPLAY = 400, 320
FILENAME = '/music/catXXX.midi'


def main():
    pygame.init()

    pygame.mixer.music.load(FILENAME)
    pygame.mixer.music.play(-1, 0.0)

    while True:
    	for event in pygame.event.get():
    		if event.type == QUIT:
    			pygame.mixer.music.stop()
    			pygame.quit()
    			sys.exit()

if __name__ == "__main__":
    main()

Исходная версия z00ke, :

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import pygame
from pygame.locals import *

DISPLAY = 400, 320
FILENAME = '/music/catXXX.midi'


def main():
    pygame.init()
    pygame.display.set_mode(DISPLAY)

    pygame.mixer.music.load(FILENAME)
    pygame.mixer.music.play(-1, 0.0)

    while True:
    	for event in pygame.event.get():
    		if event.type == QUIT:
    			pygame.mixer.music.stop()
    			pygame.quit()
    			sys.exit()

if __name__ == "__main__":
    main()