Python application extending, plugins

J

John Pote

Hi,

Has anyone any thoughts on structuring a program so that it can be extended
simply and elegantly by a user who only has a compiled (.pyc) version of the
application?

I wish to write an application, myApp, that provides a GUI to, amongst other
things, a simulator implimented as a class. myApp's simulator may then be
extended by more python code to produce what is effectively 'myApp2'. The
simulator might then be further extended from myApp2 to myApp3 in a similar
manor. Don't think there would be much call, if at all, to go beyond myApp3
level. But who knows!

Any thoughts would be appreciated.

John Pote
 
K

Kartic

John,

To achieve this, your application must define an API that third party
coders can use to extend your application.

How you define your API is upto you; there are no general "guidelines",
AFAIK. But if you want seamless extensibility, it entirely depends on
how elegantly you design the API for you application.

My approach has been to study other applications (python or otherwise)
that allow plug-ins to be written and get ideas.

You can may be look at SPE, Stani's Python Editor, as it allows
extending the app using plug-ins and there are some sample plug-ins. I
have also read some plugin-related articles at codeproject.com (VB and
C++).

The good thing about Python is its introspection that you can use to
detect the presence of certain functions in order to qualify as a
plug-in for your application. And you can use pycheck (pycheck.sf.net)
to check the plugin's python code before you load it into your
application's namespace.

Cheers!
--Kartic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top