Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python capability do like plugins ?

Reply
Thread Tools

Python capability do like plugins ?

 
 
Leon
Guest
Posts: n/a
 
      10-18-2004
example :
/home/test/plugins
a.py
b.py
c.py

main program can dynamic import plugins directory's files....not normal
”uimport”v
like winamp


 
Reply With Quote
 
 
 
 
Alex Martelli
Guest
Posts: n/a
 
      10-18-2004
Leon <(E-Mail Removed)> wrote:

> example :
> /home/test/plugins
> a.py
> b.py
> c.py
>
> main program can dynamic import plugins directory's files....not normal
> ”uimport”v
> like winamp


The main program can insert the plugins directory into sys.path and
import at will (e.g with __import__) or do it with the imp module or in
several other ways. There's a number of recipes in the cookbook...


Alex
 
Reply With Quote
 
 
 
 
Leon
Guest
Posts: n/a
 
      10-19-2004
Thanks.....
I use a simple method...

sys.commands module --> get file list
re module --> filter file name and path
imp module --> load module
getattr() --> get varabiles

because none dll for unix, I don't know how to use *.pyd
and how to make *.pyd from *.py


"Alex Martelli" <(E-Mail Removed)>
???????:1glurfj.zi6798qu4p2fN%(E-Mail Removed)...
> Leon <(E-Mail Removed)> wrote:
>
>> example :
>> /home/test/plugins
>> a.py
>> b.py
>> c.py
>>
>> main program can dynamic import plugins directory's files....not normal
>> ”uimport”v
>> like winamp

>
> The main program can insert the plugins directory into sys.path and
> import at will (e.g with __import__) or do it with the imp module or in
> several other ways. There's a number of recipes in the cookbook...
>
>
> Alex



 
Reply With Quote
 
Alex Martelli
Guest
Posts: n/a
 
      10-19-2004
Leon <(E-Mail Removed)> wrote:

> Thanks.....
> I use a simple method...
>
> sys.commands module --> get file list
> re module --> filter file name and path
> imp module --> load module
> getattr() --> get varabiles
>
> because none dll for unix, I don't know how to use *.pyd
> and how to make *.pyd from *.py


Not sure what you mean by "because none dll for unix". A *.pyd on
Windows is a DLL (meant for Python extension); you cannot make it from a
*.py, you make it from a *.c or the like. Equivalent on different Unix
variants are *.so, *.dynlib, and others yet.


Alex
 
Reply With Quote
 
Leon
Guest
Posts: n/a
 
      10-19-2004
Thank you very much,help me understand it ^_^
Now,I only use it (simple soluation). if other better soluation when modify
it
"Alex Martelli" <(E-Mail Removed)> ¼¶¼g©ó¶l„ó·s»D
:1glwgve.20tqi2sdvlc0N%(E-Mail Removed)...
> Leon <(E-Mail Removed)> wrote:
>
> > Thanks.....
> > I use a simple method...
> >
> > sys.commands module --> get file list
> > re module --> filter file name and path
> > imp module --> load module
> > getattr() --> get varabiles
> >
> > because none dll for unix, I don't know how to use *.pyd
> > and how to make *.pyd from *.py

>
> Not sure what you mean by "because none dll for unix". A *.pyd on
> Windows is a DLL (meant for Python extension); you cannot make it from a
> *.py, you make it from a *.c or the like. Equivalent on different Unix
> variants are *.so, *.dynlib, and others yet.
>
>
> Alex



 
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
Does python have the capability for driver development ? MalC0de Python 9 08-09-2009 11:51 PM
TXL-like capability? SomeDeveloper Perl Misc 2 07-11-2007 09:51 AM
key-logging capability using python ? serpent17@gmail.com Python 0 04-15-2005 12:41 PM
Looks like it is time to remove Macromedia Flash player plugins from your computers. Richard Johnson Computer Security 11 04-07-2005 12:32 PM
Does SC-12 TTL Flash cable - for Nikon F3, provide full TTL flash capability with newer Nikon units like SB-80 ? H. Brinkman Digital Photography 0 08-09-2003 10:15 AM



Advertisments