Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Parsing the command line

The module optparse was a great addition to Python 2.3, since it is much more powerful and easier to use than getopt. Using optparse, writing command-line tools is a breeze. However, the power of optparse comes together with a certain verbosity. This script allows to use optparse with a minimum of boilerplate, ...
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

Quantum Superposition

This script lets you treat  python sets.The constructor takes any number of scalars and/or Superposition instances. These items are the possible states. When doing scalar operations on such objects, the operation is delegated to its possible statbjects, tr >/ ...
Python

Timeit module wrapper

This script contains a simple, easy to use wrapper function for doing quick tests of your functions using the timeit module.The timeit module provides an easy way of testing the performance of your Python code by running it in many iterations and averaging the timings. However it is not very obvious how ...
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

Fifo as single linked lists

Fifo mean "First In First Out". This script  creates a container, which only allows element insertion and removal and where the first element inserted is the first element removed. ...
Python

Extending the logging module

This script helps you in adding new format specifiers to the logging module. In this example, it's for the user name and the name of the function that logged the message. ...
Python

Sieve of Eratosthenes

This script computes an infinite sequence of primes using simple generators. A Python dictionary is used to mark multiples of the generated primes, according to the Sieve of Eratosthenes. ...
Python

Manipulating infinite lists

This script contains some useful functions which work on infinite lists, including generalized versions of map, filter, zip on gLists. ...
Python

Fast select

This script allows you to quickly select the n-th rank ordered element of a given sequence. It modifies the ordering of the given sequence. ...
Python

Big file sorting

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

CookieInfo

The "CookieInfo" and "Cookie" classes provide developers with an read-only interface to the "cookies.txt" that most browsers store. The CookieInfo class makes Cookie objects from the cookie file. It also provides methods to operate on the whole set of Cookies. The Cookie object provides methods to convert a cookie into both ...
Python

Splitting up a sequence

This script allows you to split up a sequence in same-size (if possible) parts. ...
Python

Simple lockfile to detect previous instances

Simple lockfile to detect previous instances script implements a simple lockfile to ensure that only one instance of an application is alive at any given time. ...
Python

Type checked argument lists with decorators

This script shows you to use the new decorator feature of python 2.4 to systematically check the argument types for type-sensitive functions. ...
Python

A class keeps a reference to it s instance

This script implements a base class, which allows derived classes to track instances in self.__instances__. It uses a WeakValueDictionary to store instance references. ...
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

Symmetric data obfuscation using xor

This script can be conveniently used to obfuscate a string of data using simple xor without using any key. ...
Python

How to Set Environment Variables

This script writes the environment variables using a batch file wrapper. It overcomes an operating system limitation. ...
Python

split and join

This script will split a file into several smaller files while at the same time hiding the original formatting of the file. The program has a primitive GUI design, allowing a small amount of interaction with the program. ...
Python