我正在尝试导入本身已从另一个模块导入的同级模块。
树如下
List<double> data = new List<double>();
for (int i = 0; i < n; i++)
{
if (i <= k - p - 1)
{
alpha[i] = 1;
data.Add(NewCPVector[i] = CPVector[i]);
}
if (k - p <= i && i <= k-1)
{
alpha[i] = (FinalKnotsVector[k] - Initialknots[i]) / (Initialknots[i + p + 1] - Initialknots[i]);
data.Add(alpha[i] * CPVector[i] + (1 - alpha[i]) * CPVector[i - 1]);
}
if (i >= k)
{
alpha[i] = 0;
data.Add(CPVector[i - 1]);
}
}
代码如下
├── USA
├── NewYork
│ ├── __init__.py
│ ├── Manhattan.py
│ └── Queens.py
├── Atlanta
│ ├── __init__.py
│ ├── Buckhead.py
#Queens.py
def myFunction():
print("I am in Queens")
现在,我想在Buckhead中实例化一个曼哈顿类的对象
#Manhattan.py
from Queens import myFunction
class Manhattan():
def __init__(self):
myFunction()
print("I am in Manhattan")
我得到
#Buckhead.py
from NewYork.Manhattan import Manhattan
man = Manhattan()
我该如何实例化ITSELF从Queen模块导入功能的Manhttan类?