我定义了以下类别: 从scipy.interpolate导入interp1d
class nmat:
#def __init__(self):
def staticmat(self,cn):
self.cn_static = cn
def staticmatX2(self,cn):
self.cn_static = 2*cn
现在,我想创建此类的对象。我执行以下操作:
matw = nmat()
matw.staticmat(2.1)
matw.cn_static
有没有办法像这样输入它?
matd = nmat.staticmat(2.1)
不是先初始化?