• Advertisement
Sign in to follow this  

how do i import pygame?

This topic is 4217 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

how do i import pyame in python? i read a book on how to make games in python and they told me how to import pygame, but it said that like locals wasnt found or something.

Share this post


Link to post
Share on other sites
Advertisement
1)You go to PyGame site
2)You download the latest release for your Python version
3)You create a .py file
4)You write 'import pygame' or 'from pygame import *'

Share this post


Link to post
Share on other sites
ok, i wrote 'import pygame' at the top, then wrote 'Pygame.display.set_mode()' to set the surface. then when i ran the program, it said:
Traceback (most recent call last):
File "C:/Documents and Settings/Family/Desktop/Python junk/pygame.py", line 2, in -toplevel-
import pygame
File "C:/Documents and Settings/Family/Desktop/Python junk\pygame.py", line 4, in -toplevel-
pygame.display.set_mode()
AttributeError: 'module' object has no attribute 'display'


i tried a bunch of differnt variations, like capitalizing, uncapitalizing, adding a star, taking a star away, changing the file name, but it still has a error kind of like what i said before, but slightly different.

can i just get a code on how to import python and set a surface correctly?


wait! i got it. nm


Edit: sorry, i double posted

[Edited by - Zaku on October 8, 2006 1:36:47 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement