Python: How do you iterate over a list of filenames and import them?
Question: Suppose I have a folder called "Files" which contains a number of different
python files.

    
    
    path = "C:\Python27\Files"
    os.chdir(path)
    filelist = os.listdir(path)
    print(filelist)
    

This gives me a list containing the names of all of the python files in the
folder "Files".

I want to import each one of these files into a larger python program, one at
a time, as a module. What is the best way to do this?


Answer: add `__init__.py` to folder and you can import files as `from Files import *`

