Plugins in Python

Erik Max Francis max at alcyone.com
Thu Jun 27 23:09:04 EDT 2002


Lars Yencken wrote:

> I'm trying to do plugins for a program I'm writing in Python, and I'm
> not
> sure how exactly to do it. Basically what I want it to be able to
> write a
> module which loads every python file in a directory and stores an
> instance
> of each one that loaded successfully.

The most obvious implementation is simply to have them each imported as
modules with __import__, and define some kind of simple
initialization/shutdown API that will be called upon import.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ See the son in your bad day / Smell the flowers in the valley
\__/ Chante Moore
    Bosskey.net: Aliens vs. Predator 2 / http://www.bosskey.net/avp2/
 A personal guide to Aliens vs. Predator 2.



More information about the Python-list mailing list