Playing with modules

jjcassidy at gmail.com jjcassidy at gmail.com
Fri Feb 24 14:13:55 EST 2006


I know that this is not particularly "pythonic", but I would like to
mess with modules a bit.

I would like to develop a modular module which allows different
services to plug themselves into the module and become the
implementation for a named module.

Say I have a suite of "cassidy.blah.blah.blah...." modules. As it's not
really my intention to brand everything, I want to remap all these
modules as "home....". Thus if someone (eventually) likes my code for
x, but does not want the whole cassidy avalanche, and just wants
something simple to do home.x, they can provide their own
implementation or create a wrapper class to existing functionality
which does the work.

My problem is that this code fails all the time that I have tried to do
this.

import home.base

Does anybody know of a way to "fool" python into thinking that my suite
is actually this neutrally named suite called "home"? 

Thanks, 

John




More information about the Python-list mailing list