|Code Listing by runsun pan|
Group a list of items according to the starting character(s) of items.
This is based on Raymond Hettinger's groupby class:
Python style switches. Showing several ways of making a 'switch' in python.
A collection of some dictionary tools
<code>A dict extension that has the following features:
1. dual data storages: use 'bd.x' or 'bd["x"]' for one,
and bd.getDict() for another.
2. All the followings are equivalent::
This recipe provides an alternative way of generating and updating dictionaries. It savs couple of keystrokes, making routine dict operations easier.
Sometimes we want to have a module initialized in different ways. This function, getimporter(), while placed inside a module X, allow you to initialize module X according to the module (properties) that is importing X.
Presented in this recipe is a function prop, with that a property myprop can be created as simple as:
def myprop(): pass
It has only 7 lines of code, easy to understand, easy to customize, will make the code...
A collection of some useful list-related functions.