I wrote a implementation of conway's game of life. I set up two modes, one is auto and the other is manual, which I mean the way to ouput the result of the game. For the auto mode, I cannot stop the running progran without ctrl + q or ctrl + c (which prints out the error message). So is there any way which can allow me to stop the running program and return to the python >>> prompt by pressing some key defined by myself, say, ctrl + k. Thank you.
Are you running it from an iteractive prompt and want to just get back to the prompt. Or, are you running it from a shell and want to get to a python prompt in but with the current state of the programs execution? 
For the later it you could the keyboard interupt exception in your code and break out to the python debugger (pdb).

import pdb
try:
    mainProgramLoop()
except (KeyboardInterrupt, SystemExit):
    pdb.set_trace()
How to quit the running python program to python prompt?