Python reflection and loading/calling external module classes

C

cmckenzie

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():
 
D

Dave Angel

cmckenzie said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top