How to write python plug-ins for your own python program?

Andrew Dalke dalke at dalkescientific.com
Thu Mar 3 21:19:20 CET 2005


Mark Rowe wrote:
> A better method would be something along the lines of:
> 
> plugin = __import__(pluginName)
> plugin.someMethod()

In the one time I did a plugin architecture I found that


state = ... set up intial state for my program ...
  ...
plugin = __import__(pluginName)
plugin.someMethod(state)


was useful because it gave the plugin a way to modify
the program state, rather than changing global variables.

				Andrew
				dalke at dalkescientific.com




More information about the Python-list mailing list