How to import a module in Python with importlib.import_module

前端 未结 3 1743
臣服心动
臣服心动 2020-11-28 08:19

I\'m trying to use importlib.import_module in Python 2.7.2 and run into the strange error.

Consider the following dir structure:

    a
    |
    + - __ini         


        
3条回答
  •  余生分开走
    2020-11-28 08:49

    And don't forget to create a __init__.py with each folder/subfolder (even if they are empty)

提交回复
热议问题