我需要编写一个结构如下的Python包:
ElectricalSolver {DIR}
bus.py
line.py #contains the class lineInterface
...
Solver1 {DIR}
line.py #(specific implementation of lineInterface for the solver 1, contains the line class)
我希望每个文件有一个类,我希望在调用import时直接导入该类,如下所示:
import ElectricalSolver.Solver1.line
相反,现在我要做的是:
from ElectricalSolver.Solver1.line import line
如何指示通过类的包含文件名加载类?(如爪哇语)
这是一个好的python实践吗?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐