擅长:python、mysql、java
<p>在类中,需要使用<code>self.list.append(smth)</code>。必须使用<code>self</code>访问所有类变量</p>
<p>顺便说一下,套接字操作必须在<code>__init__()</code>中。你最好这样做:</p>
<pre><code>def __init__(self):
self.smth=socket()
self.other=[]
self.smth.DoSomething()
def Hello(self):
self.other.append("Hello") #just example
</code></pre>