Accepting keyboard input not working for me

Hi,
Sorry, I am quite a pythong newbie.
I was trying a program to accept keyboard input. It is effectively a modification of the Roaming Ralph example,
I have this excerpt of code

def setKey():
    sys.exit

base.accept("escape", sys.exit)
base.accept("arrow_left", setKey)

I know I should be posting the entire code, but really, it is way too long. This is the relevant part.

Supposedly, both Esc and arrow left should make the program exit, but what really happens is that only “ESC” makes the program exit. The arrow left doesn’t make anything.

I am not using a class. Everything is just global variables and functions. Hope this is not what is causing the troubles.

Thanks a lot in advance.

Try this:

def setKey():
    sys.exit( )

base.accept("escape", sys.exit)
base.accept("arrow_left", setKey)

sys.exit is just a pointer to the method, and sys.exit( ) calls the method.