Skip to main content

Boilerplate for Python scripting

Project description

Scripting is a boilerplate library for one-off Python scripts when you don’t have an IDE or the like to work with. It was primarily designed for Windows where scripts can be run via double-click, but it (probably) works just as well in a variety of situations.

Here’s an example what a script might look like pre-Scripting:

import traceback

def do_something():
    return 200

if __name__ == '__main__':  # Run as script
    try:  # Exceptions will close the terminal window
    except Exception:
        traceback.print_exc()  # Debug
        input()  # Keep the window open

If all you’re writing is a simple script and don’t want to deal with extensive error handling, chances are you’ll end up with something like the above. If you write such scripts often, however, the amount of boilerplate adds up and quickly becomes tedious to maintain.


import scripting

def do_something():
    return 200

Scripting takes care of exception handling, output formatting, and maintaining the terminal window for you so that you can focus on getting your script done in the shortest amount of time possible.


$ pip install python-scripting

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 python-scripting, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size (9.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page