Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Auto Incrementer Example of call and yield

This script will automatically return the next integer. It starts with 0. This is an example of how to make a generator and how to make a callable object. ...
Python

Static or Class Methods

This script implements class methods that do not require an object instance. ...
Python

Caching object creation

This script contains many recipes to memoize functions. Using this script you can cache object creation, i.e. __new__ and __init__ methods are called only when n.e. __newt;br >/ ...
Python

Bag collection class

Bag collection class script implements Smalltalk's bag class. ...
Python

Quasi Singleton Metaclass

In effect, this script provides a pattern for a set of quasi-singletons, identified by keyword. If no keyword is given, the default share is accessed. ...
Python

Number Format function

This function takes a number (integer or float) and returns a string with the integer portion grouped by thousands and the decimal portion rounded or padded to given number of decimal places. ...
Python

Splicing of lists

This script splices any number of nonempty lists as one list. Each input list may be of different length.Elements of shorter lists may be recycled when the keyword argument recycle is set to True. Any error result in an empty output list. ...
Python

Quick and easy FIFO queue class

Quick and easy FIFO queue class is an easy First-In-First-Out queue class based on Python's List data structure. ...
Python

Transposing a List of Lists

This script allows you to transpose a list of lists of different lengths. ...
Python

z matrix

This module provides two classes that emulate one and two dimentional lists with fixed sizes but mutable internals. Their primary purpose is to be used as a building tool for classes that need storage structures that cannot change in size. ...
Python

TryFinally

This script is a convenient way to deeply nest try/finally statements. It is appropriate for complicated resource initialization and destruction. For instance, if you have a list of 50 things that need to get intialized and later destructed via using try/finally (especially if you need to create the list dynamically) this function ...
Python

Debuging of object instantiation

If you are debugging a program, this script will help you to know if some special objects exist and where they came from. ...
Python

A List of Dictionaries

This  class emulates a list of dictionary objects without the memory and pickle storage overhead which occurs when storing every item in the list as a dictionary. ...
Python

Lazy streams using generators

This class allows you to use generators as more list-like streams. The chief advantage is that it is impossible to iterate through a generator more than once, while a stream can be re-used like a list. ...
Python

Extending Classes

This script contains two implementations for extending an exsisting class using metaclasses. ...
Python

Memento Closure

The memento pattern is great for transaction-like processing. This script adds transactional semantics to methods. Methods decorated with @transactional will rollback to entry state upon exceptions. ...
Python

Large File Sizes on 32 bit Windows

You can't use the os library to determine the size of large files on 32 bit Windows. This script uses the FindFiles win32call which provides among other things file size information. ...
Python

Summary reports using itertools groupby

This script produces a summary of the data, grouped by the given key (default: the first item), and giving totals of the given value (default: the second item). The key and value arguments should be functions which, given a data record, return the relevant value. ...
Python

Just in time instantiation

JIT is a class for Just In Time instantiation of objects. Init is called only when the first attribute is either get or set. Then automatic delegation is used to front for the object. ...
Python

Variant assertion

Variant assertion script is Eiffel like loop variant assertion. ...
Python