Skip to main content
Edited title to better express question being asked and removed language tag from it.
Link
martineau
  • 124.1k
  • 29
  • 181
  • 319

Loading How to load all modules in a folder in Python?

Question Protected by Ali
edited tags
Link
CharlesB
  • 91.2k
  • 29
  • 203
  • 228
Source Link
Evan Fosmark
  • 102.5k
  • 36
  • 109
  • 118

Loading all modules in a folder in Python

Could someone provide me with a good way of importing a whole directory of modules?
I have a structure like this:

/Foo bar.py spam.py eggs.py 

I tried just converting it to a package by adding __init__.py and doing from Foo import * but it didn't work the way I had hoped.