Skip to main content

Python pager module

Project description

Python module to page screen output and get dimensions
of available console space.

It is meant to be finally included into standard library

| Author: anatoly techtonik <>
| License: Public Domain (or MIT if a license is required)


0.1 (stable)
- shows content page by page
- allows to get console/terminal dimensions
- works on Windows
- works on Linux


..function:: getwidth()

Return width of available window in characters. If detection fails,
return value of standard width 80. Coordinate of the last character
on a line is -1 from returned value.

..function:: getheight()

Return available window height in characters or 25 if detection fails.
Coordinate of the last line is -1 from returned value.

..function:: getch()

Wait for keypress and return character in a cross-platform way.
Credits: Danny Yoo, Python Cookbook

..function:: page(content, [pagecallback=prompt])

Output `content` iterable, calling `pagecallback` function after each
page. Default :func:`prompt` callback shows 'Press any key . . . ' prompt
and waits for keypress.


Excellent tutorials for Win32 Console by Adrian Worley
Console Reference on MSDN

Public Domain Curses library maintained by William McBrine

Ioctl (input/output control) introduction from Wikipedia
Linux Programmer's Manual - ioctls for terminals and serial lines

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pager, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size (6.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page