Dynamic importing of modules followed by instantiation of objects with a certain baseclass from said modules

前端 未结 4 1893
温柔的废话
温柔的废话 2021-01-04 20:31

I\'m writing an application. No fancy GUI:s or anything, just a plain old console application. This application, lets call it App, needs to be able to load plugins on startu

4条回答
  •  轮回少年
    2021-01-04 20:33

    Could you use execfile() instead of import with a specified namespace dict, then iterate over that namespace with issubclass, etc?

提交回复
热议问题