Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Reverse a string

Reverse a string script allows you to reverse a string. ...
Python

Rich Comparison Mixin

This script implements the full suite of rich comparison operators if __cmp__ is defined.The __cmp__ method is sufficient to provide comparisons between user-defined classes. However, inheriting from a base class (such as a builtin) which already provides the rich-comparison methods will cause the derrived __cmp__ not to be used. cause >the/ ...
Python

Right method names suggestion

This script uses __getattr__ to modify the error messages given when a wrong class method is called. It shows the first five ranked most similar method names, followed by the first line of their docstrings (this is useful to see their parameters, if you use this convention in your sources), and ...
Python

Ruby like syntactic sugar

Ruby offers very nice language constructs for loops or for iterating over lists like the following: 5.times { print "Hello World" }. This recipe shows how to implement these features in python. ...
Python

Scope qualifier for globals

Scope qualifier for globals script contains the globaliser class that provides a scope qualifier s the glols. ...
Python

Scramble Word

Scramble word script re-arrange characters of word by using simple string manipulation and Random module. ...
Python

Separating Pattern Implementation from Your Code

This script separates pattern implementation from your code so that you can reuse the implementation elsewhere. It is an example that shows a reusable implementation of the Observer pattern. ...
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

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

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

Simple multiline interactive interpreter

This script is a simple embedded multiline python interpreter built around raw_input(). It interrupts the control flow at any given location with 'exec prompt' and gives control to the user. Allways runs in the current scope and can even be started from the pdb prompt in debugging mode.It was tested with python, jython ...
Python

Simpler item retrieval using tupled subscripting

This script shows a small addition to the tuple, list, and dictionary classes to allow for a simpler way to retrieve a number of independent items. By allowing for the subscripting to use tuples some very annoying cases becomes much simpler. This script is suitable for large data sets where you need alot of ...
Python

Simplified attribute accessors using overloading

This script presents an ideom for simplified accessors, that combines typical getter and setter functionality of an attribute into a single overloaded method, that instead of getATTRIBUTE and setATTRIBUTE can now just be called ATTRIBUTE. When called without arguments it acts as a getter and retrieves the attribute's value. When called ...
Python

Solving the Metaclass Conflict

Any serious user of metaclasses has been bitten at least once by the infamous metaclass/metatype conflict. This script contains a general recipe to solve the problem, as well as some theory and some examples. ...
Python

Some python style switches

Some python style switches script shows several ways of making a 'switch' in pyshows sevbr >/ ...
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

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

Splitting iterators

This script shows an implementation of isplit, a function that splits iterators into two equal ones, which return similar values, but are exact copies of one another. ...
Python

Splitting up a sequence

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

SQL like ORDER BY function for lists

This script contains a function that allows you to easily sort a list by multiple columns in ascending and descending order similar in function to the ORDER BY clause in SQL. ...
Python