473,498 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python plug-in

Hi,

I'm trying to find some howto, tutorial in order to create a python program
that will allow plug-in programming. I've found various tutos on how to
write a plug-in for soft A or soft B but none telling me how to do it in my
own programs. Do you have any bookmarks ??

Regards,

Laurent.
Mar 28 '06 #1
2 1179
toto wrote:
Hi,

I'm trying to find some howto, tutorial in order to create a python program
that will allow plug-in programming. I've found various tutos on how to
write a plug-in for soft A or soft B but none telling me how to do it in my
own programs. Do you have any bookmarks ??


Trac and MoinMoin have a plugin system IIRC.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Mar 29 '06 #2
toto wrote:
I'm trying to find some howto, tutorial in order to create a python program
that will allow plug-in programming. I've found various tutos on how to
write a plug-in for soft A or soft B but none telling me how to do it in my
own programs. Do you have any bookmarks ?

There is more than one way to accomplish this, but one of the
simplest is to provide a directory where plugins are loaded, and
put an __init__.py in it which automatically finds files in the directory
that conform to some standard, and imports them (or tries to).

Here's a snippet from one of my projects:

import sys, os
from Operators import Operator, operate, Ops

# Find and load all available plugin modules:

operator_path = os.path.abspath(__path__[0])
for module_file in filter(
lambda n: n[-3:]=='.py' and n not in ('__init__.py', 'Operators.py'),
os.listdir(operator_path)):
#print "Loading %s" % module_file
f, e = os.path.splitext(module_file)
__import__(f, globals(), locals(), [])
(Operators.py is in the same directory and includes general purpose
code that the plugins use -- I think it might be better design to put
that in the parent directory. But that's awkward until Python
introduces relative import notation -- supposed to be coming in v2.5).

Mar 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2651
by: Carl | last post by:
I have been using Python for quite some time now and I love it. I use it mainly for explorative computing and numerical prototyping, ie testing and trying out different kinds of algorithms and...
4
2059
by: djanvk | last post by:
QUick question: Is it possible to create a palm os program to use on a PDA with python? THanks
2
2935
by: Petri Savolainen | last post by:
Hello, has anyone seen such a beast? I tried googling, PyPI, Parnassus etc. but could not find any pure-python code nor extensions to interface with any of the existing implementations. I am...
1
2073
by: Max M | last post by:
I would like to install several copies of Python 2.4.2 on my machine, but it doesn't seem to be possible. If I allready has a version installed, the installer only gives the options to: -...
7
1545
by: Steve | last post by:
Hi folks New to the group. As a newbie to Python I`d just like to plug Ron Stephens web site which contains many excellent articles, podcasts and much Python stuff to help beginners like me. No...
10
3118
by: AKA gray asphalt | last post by:
I downloaded Blender but there was no link for python. Am I on the right track?
29
560
by: Gerald | last post by:
Hi ,Im a BSc4 Maths/Computer Science student.Unfortunately my curriculum did not include Python programming yet I see many vacancies for Python developers.I studied programming Pascal,C++ and...
7
1877
by: Chris | last post by:
I have an database containing lots of numerical data. I want to write a browser based interface that will allow selection of various key parameters and yield tables, plots and/or printouts of the...
20
6014
by: ram.rachum | last post by:
Hey, I'm looking for a good Python environment. That is, at least an editor and a debugger, and it should run on Windows. Does anyone have any idea?
68
2660
by: Santiago Romero | last post by:
( Surely if this question has been asked for a zillion of times... ) ( and sorry for my english! ) I'm impressed with python. I'm very happy with the language and I find Python+Pygame a very...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.