Portable getch() for Python.
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Py-Getch Current version on PyPI Downloads/month on PyPI

Portable getch() for Python.


More than a few times, I've had liked to just write getch() instead of raw_input(). This is the missing cross-platform functionality you've been looking for.


Install with pip:

$ pip install py-getch


from getch import getch, pause

key = getch()
print 'You pressed:', key


Wait for a keypress:

ch = getch()

This works like you'd expect, except that it returns a string.

You can also pause with the standard 'Press any key to continue. . . ' message:


Or pause with a custom message:

pause('Press any key to exit.')

You can have Python exit automatically with:

pause_exit(status=0, message='Press any key to exit.')


  1. Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found
  2. Fork the repository, make your changes, and add yourself to Authors.md
  3. Send a pull request

If your PR has been waiting a while, feel free to ping me on Twitter.