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!

Python command creation tools

Project Description



python_command provides modules to facilitate the creation of a Python command. This is primarily used to create contexts for which scripts are to be ran within.

The package is comprised of three modules:

Provides optparse options: -m, -c, –python-context, –pdb-pm
Provides loaders for, well, loading Python code. The loader interfaces from PEP302 were chosen for working with pkgutil.get_loader. The implementation of this may have been mangled a bit with file_loader and single_loader, but it was the best seemingly standard interface for such a task.
Provides the ‘execution’ class to create the execution context, and an ExtendedConsole class that provides some basic backslash commands to the Python interpreter.


# The ‘jwpython’ script is a synonym for: # (yes, lame name) $ python -m name.jwp.python.command.runtime -c ‘print “foo”’ foo

$ python -m name.jwp.python.command.runtime -m timeit 10000000 loops, best of 3: 0.0252 usec per loop

The recreated implementation of the Python command interface is done for the reason of creating contextual Python commands. While running name.jwp.python.command.runtime is completely redundant, the package provides a means for Python commands to be created with great ease.

The notable use-case is the pb_python command that takes standard PostgreSQL options and runs a Python command with an already established connection set as a builtin. Scripts written to be executed by the command only need to reference that object for database access.

Additionally, the runtime module provides an enhanced Python console and a postmortem option(–pdb-pm or –

Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jwp_python_command-1.1.1-py2.5.egg (29.3 kB) Copy SHA256 Checksum SHA256 2.5 Egg May 30, 2008
jwp_python_command-1.1.1.tar.gz (11.6 kB) Copy SHA256 Checksum SHA256 Source May 30, 2008

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting