Ok, I just learned the basics of Python yesterday, and because of other programming knowledge, I picked it up pretty fast. So then I decided to try out pygame, and I installed it directly to my Python26 directory. But none of the example code I paste from any website doesn't work. At first I tried the code from here: http://www.pygame.org/docs/tut/chimp/ChimpLineByLine.html
File name: pygame.py
Traceback (most recent call last):
File "C:\Python26\pygame.py", line 11, in <module>
import os, pygame
File "C:\Python26\pygame.py", line 12, in <module>
from pygame.locals import *
ImportError: No module named locals
And even if I tried commenting something like that out, another error about a module not being found would come up. So then I tried a simple program. The site said it basically does nothing, so I wanted to see if it would compile. This is the code:
#! /usr/bin/env python
import pygame
from pygame.locals import *
screen = pygame.display.set_mode((640, 400))
while 1:
pass
I got an error there saying
File name: pygame.py
Traceback (most recent call last):
File "C:\Python26\pygame.py", line 3, in <module>
import pygame
File "C:\Python26\pygame.py", line 5, in <module>
screen = pygame.display.set_mode((640, 400))
AttributeError: 'module' object has no attribute 'display'
So I really do not know what is wrong, since I'm pretty sure I installed it right and I'm just copying example code. Any ideas?