3 options:
Text based: Just learn how to code the console, probably using curses
2D: Use pygame
3d: Use PyOpenGL