Dynamically Reconfigurable Servers

By Ron Klatchko

Dr. Dobb's Journal January 1999

modname = "..._type"
# Remove the _type for the classname
classname = modname[:-5]
mod = dimport( modname )
obj = mod.__dict__[ classname ]()

Example 3: Instantiating an object via the () operator.

Back to Article


Copyright © 1999, Dr. Dobb's Journal