4 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for DragonMastur
Member Avatar for DragonMastur
0
408
Member Avatar for Gribouillis

I uploaded a module named [symboldict](https://pypi.python.org/pypi/symboldict) to the python package index (pypi). This snippet shows how to use it to create a dictionary of symbols from various modules. This dictionary can be used as a common language shared by several modules. It can be used to load python libraries in …

Member Avatar for Gribouillis
4
515
Member Avatar for Gribouillis

This snippet allows one to implement an equivalent of a `__getattr__()` function in a python module. The module can then define its own way to lazily import abitrary symbols. For example the module can contain infinitely many names or load values from other modules on demand. There are many implementations …

Member Avatar for Gribouillis
1
475
Member Avatar for pythopian

PlugIns in their simplest form can be just python modules that are dropped into some designated directory and dynamically loaded by the main application. This snippet can be used to do just that. [B][U]Usage[/U][/B] To load plugin modules: [CODE]>>> plugins = importPluginModulesIn('mypackage') >>> plugins {'foo': <module 'foo' from 'mypackage\foo.py'>, 'bar': …

Member Avatar for pythopian
2
807

The End.