So I'm working with
pygame==1.9.6 Python 3.8.2
from pygame import *
init()
running == True
while running:
for event in event.get():
if event.type == QUIT:
running = False
even only this code gives me error:
Traceback (most recent call last): File "main.py", line 77, in <module> for event in event.get(): AttributeError: 'Event' object has no attribute 'get'
other things like screen.blit(args), image.load(args), screen.fill(args), etc works perfect
The problem is that you are having a namespace collision because of the way you have imported pygame:
from pygame import *
You are importing all the methods and attribute names in the pygame module directly into the same namespace as your program. That is not generally good practice and can result in the collision you are having, where the event variable you are trying to define locally is colliding with the existing event variable from the pygame module. Instead you should import it like this:
import pygame
Then access the items from the pygame module by prepending the module name to them. Like this:
for event in pygame.event.get():
If you do it this way you avoid the two events being confused with each other.