title: Python socket wait
body: <p>I was wondering if there is a way I can tell python to wait until it gets a response from a server to continue running.</p>
  
  <p>I am writing a turn based game. I make the first move and it sends the move to the server and then the server to the other computer. The problem comes here. As it is no longer my turn I want my game to wait until it gets a response from the server (wait until the other player makes a move). But my line:</p>
  
  <pre><code>data=self.sock.recv(1024)
  </code></pre>
  
  <p>hangs because (I think) it's no getting something immediately. So I want know how can I make it wait for something to happen and then keep going.</p>
  
  <p>Thanks in advance.</p>