Re: 2 questions about python
Type "pip3 install pygame" on the command line. Then in the python shell type:
import pygame
pygame.version.ver
That should tell you the pygame version, if installed correctly. Note that python IDLE doesn't play nice with screen readers, but you can use any text editor and save a script as a plain text document with a *.py prefix, then run it on the command line with "python yourscript.py". Here's a simple pygame example to help you get started:
import pygame
from pygame import mixer
import sys
def Example(): #initialize pygame pygame.init() #initialize sound mixer mixer.init() #create display window = pygame.display.set_mode([640,480]) #load sound sound = mixer.Sound('tone5.wav') #main update loop while True: for event in pygame.event.get(): if event.type == pygame.KEYDOWN: #if space is pressed, play sound if event.key == pygame.K_SPACE: sound.play() #if escape is pressed, quit if event.key == pygame.K_ESCAPE: pygame.quit() sys.exit(0) #update window pygame.display.update() Example()
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector