python - Why am I getting this AttributeError ? (python3 , pygame) -


below error receiving , code have written. know similar questions have been asked , solutions given not relate case. , can't seem figure out why receiving attribute error. running python 3.3 , pygame. os im on ubuntu 12.10. hope can find solution problem can continue working on physics simulation.

traceback (most recent call last):   file "/media/lawton/d4b1-5b96/programming/python/gamephysics.py", line 9, in <module>     screen = pygame.display.set_mode((width, height)) attributeerror: 'module' object has no attribute 'display' 
import pygame   background_colour = (255,255,255)  (width, height) = (300, 200)  screen = pygame.display.set_mode((width, height))  pygame.display.set_caption('tutorial 1')  screen.fill(background_colour)  pygame.display.flip()  running = true while running:   event in pygame.event.get():     if event.type == pygame.quit():       running = false 

you shadowing pygame library pygame.py file, in same location gamephysics.py.

print out file path of offending module:

import pygame  print('path pygame module:', pygame.__file__) 

this show 'rogue' module located. once find it, rename else.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -