1. 程式人生 > >字符串形式導入模塊

字符串形式導入模塊

crm mod col others pan color sch rtl 導入模塊

import importlib
importlib.import_module(app01)
<module app01 from D:\\my-ws-python\\b_othersource\\pub_school_crm\\dj_crm\\app01\\__init__.py>
importlib.import_module(app01.models)
<module app01.models from D:\\my-ws-python\\b_othersource\\pub_school_crm\\dj_crm\\app01\\models.py>
m
=importlib.import_module(app01.models) m.UserProfile <class app01.models.UserProfile>

字符串形式導入模塊