I am writing a python package. I use the concept of plugins - where each plugin is a specialization of the Worker class. Each plugin is written as a module (script?) And generated in a separate process.
Due to the basic commonality between the plugins (for example, everyone extends the base class "Work"), the plugin module usually looks like this:
import commonfuncs
def do_work(data):
print 'child1 does work with %s' % data
In C / C ++, we include security devices that prevent the inclusion of a header more than once.
I need something like this in Python, and if so, how can I make sure that commonfuncs is not "enabled" more than once?
source
share