Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Plugins for a Python program

Reply
Thread Tools

Plugins for a Python program

 
 
OldAl
Guest
Posts: n/a
 
      09-27-2009
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...
 
Reply With Quote
 
 
 
 
John Nagle
Guest
Posts: n/a
 
      09-27-2009
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make the program can accept plugins to extend its functionalities? www Java 4 03-10-2007 11:18 AM
Python application extending, plugins John Pote Python 1 01-09-2005 02:04 PM
Python capability do like plugins ? Leon Python 4 10-19-2004 05:41 PM
RE: "python exe" and "py plugins" Marc Boeren Python 7 11-20-2003 10:00 PM
"python exe" and "py plugins" marco Python 2 11-18-2003 03:35 PM



Advertisments