Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A set of input and output functions for the command line.

Project Description

IOTk is a set of functions that make it easy to display output and get input from the command line.

Input Functions

Gets a string value from the user.
Asks the user for a value and makes sure that it’s an integer.
Checks for “yes” or “no” against 8 languages, plus plain old “y” and “n”.
Asks the user for a filename, then verifies that it exists.
Asks the user for a folder name, then verifies that it exists.
Gets a string from the user and verifies it against a regular expression. It can be supplied a custom invalidation message so the user doesn’t see “Must match the regular expression: ” followed by a bunch of apparently random characters and stop using your program out of frustration.

Output Functions

If the COLUMNS environment variable is set, this will take it. If not, it assumes 80.
Prints the keys and values in a dictionary, with incredibly flexible formatting options.
Prints the items in a list, with the same formatting options as print_dict.
A powerful word-wrapping function that will wrap words to a certain number of columns.
A thick wrapper around wrap_str that provides alignment and fill options.
Writes a line of text and underlines it.
The famous implementation from PEP 257, this will strip leading whitespace from a docstring.

Release History

This version
History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(4.6 kB) Copy SHA256 Hash SHA256
Source None Jan 1, 2009

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate