I have a problem with pep 8 and my Python code concerning Pygame constant on the next piece of code, which is sending me error E0602 "Undefined variable" when i use the pygame constant "KEYDOWN" "K_F1" K_ESCAPE"
is there any trick to solve this problem with pep8
I am a beginner and I admit that I do not find a solution to solve this problem :(
def run(self):
""" start loop """
loop = True
while loop is True:
self.windowSurface.blit(self.Sprite.home, (0, 0))
self.pygame.display.flip()
for event in pygame.event.get():
if event.type == KEYDOWN:
if event.key == K_F1:
loop = False
elif event.key == K_ESCAPE:
sys.exit(1)