Readable switch construction Download
Friday, May 30th, 2008Python’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 r
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 r
wxParser allows you to parse documents with regular expression to the tree and edit them or replace some of the data, powered by your own python code.
Python is ver
This script provides "Registry", a Windows registry wrapper class that makes it easy to work with the Windows registry.
The class works with an inner
This script allows you to record the order in which items are added. This implementation uses much less code than the others by extending not well-known class DictMixin.
The KeyedDict object keeps a list of approved key values. If you try to assigned an unapproved key to a value, an exception is thrown.
When you create the object, y
This script grabs a part of a web page and generarte a new page with a base href to the source server, so that relative links will still work.
Reads through files and replaces swear words with euphemisms. Uses regular expressions in order to also match common ways to circumvent censors. ("d@mn","h3ll&qu
While evolving code, there is often a need to enrich an existing simple return scheme of a function by extra/optional return values.
Using (variable lenght) return
This script is a pure python drop in replacement for collections.deque(). It uses a dictionary as the underlying data structure for the deque (pronounced "deck", short f
This script defines a dictionary with attribute-style access. It maps attribute access to the real dictionary.
It can be easier to read and type data access us