Python reflection and loading/calling external module classes

Discussion in 'Python' started by cmckenzie, Dec 1, 2009.

  1. cmckenzie

    cmckenzie Guest

    Hi! I've been putting off playing with Python for sometime now and I
    recently came up with a worthwhile project for my first hack. One
    technical challenge I'm trying to work out is dynamically loading
    modules from a directory (glob'd for a specific filename format) then
    importing them for calling later.

    Basically my modules follow this structure:

    class sample():
    cmckenzie, Dec 1, 2009
    #1
    1. Advertising

  2. cmckenzie

    Dave Angel Guest

    cmckenzie wrote:
    > Hi! I've been putting off playing with Python for sometime now and I
    > recently came up with a worthwhile project for my first hack. One
    > technical challenge I'm trying to work out is dynamically loading
    > modules from a directory (glob'd for a specific filename format) then
    > importing them for calling later.
    >
    > Basically my modules follow this structure:
    >
    > class sample():
    >
    >

    Your message was cut-off before you finished, but the answer is
    probably the built-in function __import_().


    DaveA
    Dave Angel, Dec 1, 2009
    #2
    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. guava
    Replies:
    1
    Views:
    2,673
    Joseph Millar
    Aug 8, 2003
  2. Carfield Yim
    Replies:
    1
    Views:
    1,392
    Andrew Thompson
    May 31, 2004
  3. mathieu gontier
    Replies:
    1
    Views:
    313
    Alex Martelli
    Sep 1, 2004
  4. Replies:
    10
    Views:
    961
  5. Thomas
    Replies:
    1
    Views:
    96
    Thomas
    Sep 1, 2003
Loading...

Share This Page