Python Forum
[split] Apparently module has no attribute display?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Apparently module has no attribute display?
#1
Im trying to learn to use pygame but wheni run this code it gets error for all the attributes of pygame:

import pygame
from pygame import *

pygame.init()

gameDisplay = pygame.display.set_mode((800,600))

pygame.dislpay.setcaption('Pygame Game')

clock = pygame.time.Clock()

crashed = False

while not crashed:
	for event in pygame.event.get():
		if event.type == pygame.QUIT:
			crashed = True
			
		print(event)
		
	pygame.display.update()
	
	clock.tick(30)
	
pygame.quit()
quit()
Please tell me how to fix that. Im working in Ubuntu 16.04
Reply
#2
I guess your own file is named pygame.py....If that is the case - rename it to something else
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] How to display isometric maps with pygame? mattwins 6 6,270 Nov-17-2020, 12:54 PM
Last Post: mattwins
  [split] Apparently module has no attribute display? Angelo26 1 2,011 Mar-11-2020, 07:14 PM
Last Post: nilamo
  [PyGame] Apparently module has no attribute display? Klar 29 27,392 Dec-20-2017, 02:46 AM
Last Post: Windspar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020