Detect Keypress in python

I am working on a program, where i need to detect the specific key press in the python code.

I had done quite some programming in python, but none in regards to the capture of key events.

Can anyone please guide me in this.