Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Pseudo random string to float conversion

Pseudo-random string to float conversion script converts strings to floats in the range [0, 1), using a hash function. ...
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

PyCrash

PyCrash is a Run-Time Exception Dumper which handles uncaught exceptions during the execution of Python programs and collects information about the program context. PyCrash can be very useful in report bug information, because the programmer can easily analyse the program execution context of the crashed application. PyCrash provides you following informations: ...
Python

pykill

This is a python script very loosely approximating pkill that is a Linux command: will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout. ...
Python

Pythologic Prolog syntax in Python

Some of Python's powerful meta-programming features are used to enable writing Python functions which include Prolog-like statements. Such functions load a Prolog-like database. When coupled with a suitable inference engine for logic databases, this is a way to add logical programming -- the last unsupported major paradigm -- to Python. This ...
Python

Python Octree Implementation

This script is a simple implementation of an octree data structure in python. Its use is primarily for fast collision or view frustrum culling in interactive 3d environments, but its possible uses are quite open-ended. It was originally written for use with the pyOgre 3d engine binding. The code makes use of ...
Python

Python symbols

Python symbols is a toy module that shows a way to define symbols inside functions, using a decorator. ...
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

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

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

Rabin Miller probabilistic prime test

In this script is included a method for performing the Rabin-Miller probabilistic test for a composite witness.  Rabin-Miller test can only tell us if a value is definitely composite. In the case where a test value is not a witness for the compositeness of a potential prime, it can only lie with a probability ...
Python

Random Password Generation

Random Password Generation script is a code snippet to generate an 8 character alphanumeric password. ...
Python

Rating class with mapping interface

Rating class with mapping interface script deals with items sorted by value and accessed by key or rating index. ...
Python

Read write object for pkg config files

The PkgConfig class is useful by itself. It allows reading and writing of pkg-config files. This file, when executed, will read a .pc file and print the result of processing. The result will be functionally equivalent, but not identical. Re-running on its own output should produce identical results. ...
Python

Readable switch construction

Python's lack of a 'switch' statement has garnered much discussion and even a PEP. The most popular substitute uses dictionaries to map cases to functions, which requires lots of defs or lambdas. While the approach shown in this script may be O(n) for cases, it aims to duplicate C's original 'switch' functionality ...
Python

Rebind class properties

Sometimes you define properties in base class and override the getter setter methods in derived classes. Then you find out the base class though has derived properties are still pointing to baseclasse's methods not the overriden ones. ...
Python

Reloading all modules

When you create a Python module, you can use a test script wich import your module. But you probably have noticed that when you run the test script, it always use the first version of your module even if you made changes in the code.This is because the import statement check ...
Python

Remote control with telnetlib

This script sends commands to one or more logins using Python's standard telnetlib module. ...
Python

Remove duplicates from a sequence

The fastest way to remove duplicates from a sequence depends on some pretty subtle properties of the sequence elements, such as whether they're hashable, and whether they support full comparisons. This script defines the unique() function that tries three methods, from fastest to slowest, letting runtime exceptions pick the best method available for ...
Python

Restrictive APIs for Python

Python has no inherent provision for a restrictive API that blocks accesses to methods and variables outside an allowed set. Inexperienced Python programmers may fail to adhere to an agreed-upon API, directly accessing the private internals of a class. Adherence to defined APIs is a good thing. This script contains a  ...
Python