Plugins for a Python program

Discussion in 'Python' started by OldAl, Sep 27, 2009.

  1. OldAl

    OldAl Guest

    I am impressed with Bazaar's implementation of plugins: a Python
    plugin is simply copied to a ./bazaar/plugin/<my-plugin> directory and
    the plugin is recognized by Bazaar and can be run from CLI as:

    bzr <my-plugin>

    I would like to implement something similar in my Finite Element
    Method program, so that any user can write certain element properties
    (in a predetermined format) to use with the program.

    The references that I looked at seem to use "distutils" as part of the
    plugin installation. Would you recommend to go in that direction?
    Any other good references?

    BTW, the FEM program is currently designed to solve Engineering
    structure analysis with the implemented elements for beams (frame
    members) or truss members for 2D structures and also trusses in 3D
    structures.

    OldAl
    PS: Trust me, I am really, really old...
     
    OldAl, Sep 27, 2009
    #1
    1. Advertising

  2. OldAl

    John Nagle Guest

    OldAl wrote:
    > I am impressed with Bazaar's implementation of plugins: a Python
    > plugin is simply copied to a ./bazaar/plugin/<my-plugin> directory and
    > the plugin is recognized by Bazaar and can be run from CLI as:
    >
    > bzr <my-plugin>
    >
    > I would like to implement something similar in my Finite Element
    > Method program, so that any user can write certain element properties
    > (in a predetermined format) to use with the program.


    CPython can execute "import" operations at run time. The form is

    s = "modulename"
    X = __import__(s)

    So you can load plug-ins from within your running program.

    John Nagle
     
    John Nagle, Sep 27, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. marco

    "python exe" and "py plugins"

    marco, Nov 18, 2003, in forum: Python
    Replies:
    2
    Views:
    342
    Miki Tebeka
    Nov 18, 2003
  2. Marc Boeren

    RE: "python exe" and "py plugins"

    Marc Boeren, Nov 18, 2003, in forum: Python
    Replies:
    7
    Views:
    382
    Ahmad Baitalmal
    Nov 20, 2003
  3. Leon
    Replies:
    4
    Views:
    328
  4. John Pote

    Python application extending, plugins

    John Pote, Jan 7, 2005, in forum: Python
    Replies:
    1
    Views:
    270
    Kartic
    Jan 9, 2005
  5. www
    Replies:
    4
    Views:
    400
    Roland Pibinger
    Mar 10, 2007
Loading...

Share This Page