User avatar
Mahan_Micro
Posts: 44
Joined: Tue Aug 04, 2015 8:52 pm

my problem with pygame EVENT !

Mon Aug 31, 2015 5:24 pm

Hi
I'm learning python by Mag pi :)
in mag pi 33 , there is a code for keyboard contrrol (keyboard.py)
when i compile it,i see following error :

if event.key == pygame.K_UP:
'module' object has no attribute 'K_UP' :!: :!: :!:

why????? in first I import :
import pygame, sys
import pygame.locals as GAME_GLOBALS
import pygame.event as GAME_EVENTS

what's your idea ?? :?:
If your Dreams Don't Scare You , They Aren't Big Enough

User avatar
Mahan_Micro
Posts: 44
Joined: Tue Aug 04, 2015 8:52 pm

Re: my problem with pygame EVENT !

Mon Aug 31, 2015 5:26 pm

excuse me , program runs correctly but when I push a key of keyboard this error apear and program stop
If your Dreams Don't Scare You , They Aren't Big Enough

Return to “The MagPi”