Python capability do like plugins ?

Discussion in 'Python' started by Leon, Oct 18, 2004.

  1. Leon

    Leon Guest

    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
    Leon, Oct 18, 2004
    #1
    1. Advertising

  2. Leon <> 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
    Alex Martelli, Oct 18, 2004
    #2
    1. Advertising

  3. Leon

    Leon Guest

    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" <>
    ???????:1glurfj.zi6798qu4p2fN%...
    > Leon <> 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
    Leon, Oct 19, 2004
    #3
  4. Leon <> 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
    Alex Martelli, Oct 19, 2004
    #4
  5. Leon

    Leon Guest

    Thank you very much,help me understand it ^_^
    Now,I only use it (simple soluation). if other better soluation when modify
    it
    "Alex Martelli" <> ¼¶¼g©ó¶l¥ó·s»D
    :1glwgve.20tqi2sdvlc0N%...
    > Leon <> 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
    Leon, Oct 19, 2004
    #5
    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. Replies:
    0
    Views:
    314
  2. Patrick Kowalzick
    Replies:
    5
    Views:
    469
    Patrick Kowalzick
    Mar 14, 2006
  3. MalC0de
    Replies:
    9
    Views:
    1,536
    John Nagle
    Aug 10, 2009
  4. Michel Claveau - MVP
    Replies:
    9
    Views:
    308
    Steven D'Aprano
    Aug 2, 2009
  5. SomeDeveloper

    TXL-like capability?

    SomeDeveloper, Jul 10, 2007, in forum: Perl Misc
    Replies:
    2
    Views:
    108
    Peter J. Holzer
    Jul 11, 2007
Loading...

Share This Page