Supply a plugin interface

Johannes Bauer dfnsonfsduifb at gmx.de
Thu Apr 23 03:47:56 EDT 2009


Hello group,

I'm developing a GUI application in Python and having a blast so far :-)

What I'd like to add: I want the GUI users to supply plugin scripts,
i.e. offer some kind of API. That is, I want the user to write short
Python pieces which look something like

import guiapp

class myplugin():
	def __init__(self):
		guiapp.add_menu("foobar")

	def exec(self, param):
		print("foo")

the GUI application should now browse the plugin directory and read
those plugin python files and somehow incorporate (i.e. discover what
modules are there, instanciate, etc.)

How do I do that at runtime with Python?

Kind regards,
Johannes

-- 
"Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit,
verlästerung von Gott, Bibel und mir und bewusster Blasphemie."
         -- Prophet und Visionär Hans Joss aka HJP in de.sci.physik
                         <48d8bf1d$0$7510$5402220f at news.sunrise.ch>



More information about the Python-list mailing list