如何替换Python模块名称?

时间:2019-01-08 21:33:14

标签: python python-3.x

是否可以像以下示例中那样替换Python模块名称?

import mymodule as mm
from mymodule.myfile import myfunction  # Works   
from mm.myfile import myfunction        # ImportError: No module named 'mm'

1 个答案:

答案 0 :(得分:1)