擅长:python、mysql、java
<p>缺少方法调用的()。如果不使用()则打印方法对象的字符串表示形式,对于所有可调用项(包括自由函数)也是如此。</p>
<p>确保对所有方法调用都这样做(<code>self.method</code>1和<code>thisObj.method2</code>)</p>
<pre><code>class ThisClass:
def method1(self):
text1 = 'iloveyou'
return text1
def method2(self):
text2 = self.method1()
print str(text2)
thisObj = ThisClass()
thisObj.method2()
</code></pre>