Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Portable getch() for Python.
Python
Branch: master
Failed to load latest commit information.
getch Set version to 0.1.0.
.gitignore Remove unused .gitignore entry.
CHANGES.md Set version to 0.1.0.
LICENSE Update LICENSE.
MANIFEST.in Add setup.py.
README.md Readme: Colon.
requirements.txt Add setup.py.
setup.py Set version to 0.1.0.

README.md

Py-Getch

Portable getch() for Python.

Motivation

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

I don't anticipate this to be used in any major projects. Rather, installed globally and used in those one-off scripts that you'd like to have just a bit more professionalism with. Using raw_input for single-key capture and pause mechanism makes a hacked-together script feel even more like just that.

Installation

Install with pip:

$ pip install py-getch

Usage

from getch import getch, pause

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

API

getch()

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

pause(message='Press any key to continue. . . ')

For proper pause functionality.

Something went wrong with that request. Please try again.