I am learning python on my raspberry pi 3, so I thought that I would try to add some graphics. I was trying to bring up a window to add my graphics on, but it brings up the following error message:
Traceback (most recent call last):
File "/home/pi/python_programmes/pygame1.py", line 1, in <module>
import pygame
File "/home/pi/python programmes/pygame.py", line 6, in <module>
AttributeError: 'module' object has no attribute 'init'
The code that I entered is:
import pygame
pygame.init()
size = [700, 500]
screen = pygame.display.set_mode(size)
pygame.display.set_caption("My game")
done = False
clock = pygame.time.Clock()
while done == False:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
clock.tick(20)
pygame.quit()
I deleted all files that where called pygame.py, but there is still one that is called pygame.pyc