Jump to content
  • Advertisement
Sign in to follow this  
Zaku

how do i import pygame?

This topic is 4418 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
oh is that all? i wrote import python, but the book also told me to add other stuff to it.

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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!