Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Automated swigging for creating C shared modules

This script contains a simple python function to automate using the swig process for creating C modules for use inside Python. ...
Python

Automatic indentation of output

This script is an output stream wrapper; possibly useful for debugging code with print statements. When write() is called, it makes a note of the calling frame. The indentation level is equal to the number of frames in the call stack which have been previously noted. ...
Python

Bag collection class

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

base64 encoding prototype

This script takes a decimal number, converts it into binary, takes the first six numbers in that, converts that into a decimal number, and from there makes it a letter("m") according to the base64 code. ...
Python

Basic Linear Algebra Matrix

This script defines the Matrix class, an implementation of a linear algebra matrix. Arithmetic operations, trace, determinant, and minors are defined for it. This is a lightweight alternative to a numerical Python package for people who need to do basic linear algebra. Vectors are implemented as 1xN and Nx1 matricies. There is ...
Python

Big file sorting

Big file sorting script allows you to sort big ASCII files. ...
Python

Binary floating point summation

This script eliminates completely  rounding errors and loss of significance due to catastrophic cancellation during summation. It  achieves exactness by keeping full precision intermediate subtotals. Offers three alternative approaches, each using a different technique to store exact subtotals. ach >using/ ...
Python

Binary search in one line

This is an implementation of the binary search algorithm in (almost) one line. Given a number 'n' and a list 'L', the function returns the index of the number on the list, or -1. ...
Python

Buffered Stream with Multiple Forward Only Readers

This script provides a buffered stream that supports multiple forward-only readers. The buffer enables readers that are behind the front-runner to access values that have already been read from the stream. Values that are no longer accessible by any reader are cleared from the buffer. ...
Python

Caching decorator with timeout invalidation

This script is a caching decorator that  collects garbage in a separate thread (for performance).It allows each cached function to (optionally) set a custom maximum age for entries, and allows individual cache entries to be selectiries, andlidated.This kind of caching decorator is often useful in web development, when your pages are ...
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

Call a Callback when a Tkinter Text is Modified

This script shows you how to make use of the virtual event that determines to call your own callback. Tkinter Text widget notices when it's modified. ...
Python

Call a function method X times per second

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

Case insensitive Dictionary

Case-insensitive Dictionary script is a dictionary that has case-insensitive keys. An internal dictionary maps lowercase keys to (key,value) pairs. All key lookups are done against the lowercase keys, but all methods that expose keys to the user retrieve e lowercanal keys. ...
Python

Changing a closed over value in a cell

In most languages with closures, it is possible to change a closed-over value and have the change visible in other closures which share a reference to the same variable. Python's syntax makes this impossible. Putting your changeable values inside a mutable object like a list-- it may occasionally happen that you ...
Python

Changing file attributes on windows

The win32api module offers SetFileAttributes whiles allows you to make changes to a file in windows. You can set a file to be read only, archive, hidden, etc. This script is simple and convenient to use. ...
Python

Changing return value for mutating list methods

Mutating list methods such as 'append' or 'extend' return None instead of the (mutated) list itself. Sometimes, this is not the desired behaviour. To have a reference to the (mutated) list returned is usefull, if one wants to chain commands such as mylistinstance.append(7).sort(). ...
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

Classmethod emulation in python2 1

Class methods were introduced in python2.2. This script illustrates how the same effect can be achieved in python 2.1. ...
Python