[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Help configuring Pygame on OS X Leopard
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Help configuring Pygame on OS X Leopard
- From: Unnsse Khan <untzkhan@xxxxxxxxx>
- Date: Sat, 1 Dec 2007 19:10:48 -0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 01 Dec 2007 22:11:00 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer; bh=LMMnCPHuuArHblh78DZr2ke1V5kvO66+qjOO4y/GeYo=; b=i21N/SD7BGIEEfylVrIsLSHWc0sKCu+nxMtGNXmASXrRgeytICCxhUgxmrrQeuHGh7Insdj1CYMo+htnSNApsolZ9a+SD8fLGilRrGQ+KSzTFJ525uCa9RJtEt7i0+B5CoEqtbkY576W3JUKEnZFcL7Ghfzn531FdhvJSeiaBG0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer; b=AmZdKyQ7wyDaYUZAxRm9T5ly0o++b/aM+3zdaLdGSTFaNUGCYSImhCJBQaM473ZdrLfx4g0mI7m1+Uxaqz8UcSRX03zzkmse/2kA3+RLrKwXt20YCrHFG0/TpQf+l39OqK7+XikWPAvvE9QJcaMZ7VUW1W/ZYbdXxMb0SqGp+P4=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hello there,
I am a Python / Pygame newbie...
Installed Pygame by installing the following files located at:
http://pythonmac.org/packages/py25-fat/index.html
Am running Python 2.5 on OS X Leopard...
Copied the following code from Pygame online tutorial:
#!/usr/local/bin/python
import pygame
from pygame.locals import *
def main():
# Initialize screen
pygame.init()
screen = pygame.display.set_mode((400,100))
pygame.display.set_caption('Basic Pygame program')
# Fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill((250, 250, 250))
# Display some text
font = pygame.font.Font(None, 36)
text = font.render("Hello Unnsse!", 1, (10, 10, 10))
textpos = text.get_rect()
textpos.centerx = background.get_rect().centerx
# Blit everything to the screen
screen.blit(background, (0, 0))
pygame.display.flip()
# Event loop
while 1:
for event in pygame.event.get():
if event.type == QUIT:
return
screen.blit(background, (0, 0))
pygame.display.flip()
if __name__ == '__main__': main()
When I ran this program, I receive the following error message:
Traceback (most recent call last):
File "/Users/untz/DevResources/Python/pygame_helloworld/hello.py",
line 3, in <module>
import pygame
ImportError: No module named pygame
What am I possibly doing wrong?
Happy programming,
Unnsse