繁体   English   中英

Class 'x' 没有 'y' 成员

[英]Class 'x' has no 'y' member

我一直在尝试使用属于同一个 class 的另一种方法的变量来进行比较。

我的代码如下所示:

def __init__ (self, Title, Complexity, Time):
    self.Title = Title                       
    self.Complexity = Complexity
    self.Time = Time 

def organizatingTime(self):
    if Activitie.Complexity() > 6:
        time = Activitie.Time()

但是VS向我展示了

Class 'Activitie' has no 'Time' member
Class 'Activitie' has no 'Complexity' member

任何有效的东西都是好的。

尝试

   def __init__ (self, Title, Complexity, Time):
        self.Title = Title                       
        self.Complexity = Complexity
        self.Time = Time 

    def organizatingTime(self):
        if self.Complexity() > 6:
            time = self.Time()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM