Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Constellation Finder

The script demonstrates the use of SETs in Python. There is a key object that has constellations already identified and a stars object that contains the stars in the sky. Keys are used to unlocks the stars and the results are printed out for the user of the program. ...
Python

Function composition

This script contains two classes that show two styles of function composition. The difference is only when the second function (g) returns a tuple. compose function passes the results of g as a tuple, mcompose treats it as a tuple of args to pass along. Note that extra args provided to (m)compose are treated ...
Python

Improved Gray Scale Quantization

Improved Gray Scale (IGS) codes are used for the elimination of false contouring in images, and image compression. This Python program generates the IGS codes for a set of input gray level values. ...
Python

Format number function

For many languages it is possible to use the locale module to format numbers. But there are at least three languages for which the locale.localeconv()['thousands_sep'] is empty: brazilian portuguese - 'pt_br', portuguese - 'pt' and spanish - 'es'. The first function, format_positive_integer() will return the passed integer number as a string ...
Python

Infix Postfix

This script is useful to convert an infix expression to postfix and vice-versa. You can also evaluate infix and postfix expressions. ...
Python

Class with default method handler

This script is a class whose objects can handle undefined method calls, passing them on to a default handler. ...
Python

pkgconfig parser

This script creates a class to allow access to variables stored in pkg-config files ( or '.pc' files ). This is usefull in conjunction with distutils to get correct information for compiling external C/C modules. Variable substitution is performed with string.Template. ...
Python

Dictionary Mixin Framework

This script makes it easy to provide a full dictionary interface to a class defining only a few mapping methods for getting, setting, deleting, and listing keys. Also, a function is provided to incorporate the mixin at runtime so that code for existing modules need not be modified.By usmodules nixin as a superclass, ...
Python

Shed Skin

Shed Skin is an experimental Python-to-C compiler. It can convert pure, but implicitly statically typed Python programs into optimized C code. Currently, these programs cannot freely use the Python standard library. ...
Python

Criteria based cascading priority queue

This module provides a simple criteria-based priority queue with "priority cascading".The criteria argument should be a sequence of callables that return boolean values. There is no need to add an "all pass" criterion at the end; the queue will add all non-matching items with the least priority.ill add >a ...
Python

Memory usage

Memory usage script provides a number of functions to get the memory usage of a Python application on Linux. ...
Python

Lazy Traversal of Directed Graphs

The os.path.walk routine that ships with the python standard library is limited to traversing the file system tree. This script allows you to realize a generic traversal for arbitrary (directed) graphs with support for recursion limits. ...
Python

Call a function method X times per second

This simple generator function is used to call a function X times per second. ...
Python

Integrating Twisted reactor with IPython

This script allows you to run the Twisted reactor event loop in a thread alongside an IPython shell, for introspecting a running Twisted process. ...
Python

A friendly mkdir

This scripts provides a function mkdir() more friendly than Python's standard os.mkdir(). Limitations: it doesn't take the optional 'mode' argument yet. ...
Python

Extensible object to XML converter

This function generates XML for any Python object through recursive functions. It is easy to add specific handlers for your own object types for more complex output options. ...
Python

IPv4 address set type

IPv4 address set type script initializes an ip4range class.The constructor accepts an unlimited number of arguments that may either be tuples in the form (start,stop), integers, longs or strings, where start and stop in a tuple may also be of the form integer, long or string. Passing an integer or long ...
Python

Octal Encryption

This script helps you to get the octal representation of text. ...
Python

Docstring coverage

This script is a tool to examine lack of docstrings in a module. It prints a rundown of the classes, functions, and methods in the given module that have not been given a docstring. ...
Python

Public and protected attribute access

This script presents a way to introduce proper attribute access protection levels using a generic proxy object. By default all attributes are "protected" in the C sense and can be declared as public using either a function decorator or a class attribute. ...
Python