擅长:python、mysql、java
<p>在python中,您可以使用<a href="http://docs.python.org/tutorial/controlflow.html#pass-statements" rel="nofollow">^{<cd1>}</a>关键字来基本上“不做任何事情”。</p>
<pre><code>for socket.user in MyServer.users:
if MyServer.users.has_key(socket.user) == False:
pass
</code></pre>
<p>然而,更正确的方法是以一种满足您希望的方式编写代码;而不是按照您不需要的方式编写代码。</p>
<pre><code>for socket.user in MyServer.users:
if MyServer.users.has_key(socket.user) == True:
MyServer.users[user].send(socket.message)
</code></pre>