Plugins for a Python program

O

OldAl

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...
 
J

John Nagle

OldAl said:
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
 

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,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top