title: Python socket works as a telnet connection and requires double read
body: <p>I'm connecting to the device using telnet. Once I connected, I need to enter user name <code>admin</code>, press enter <code>\n</code> and use blank password (enter again <code>\n</code>). After the described login process I should end up with the invitation <code>(prompt) #</code>.  I'm reading from the socket after each write. The program is below: </p>
  
  <pre><code>import socket
  
  s = socket.socket()
  #Connecting using telnet
  s.connect(('192.168.1.2',23))
  a = s.recv(1000)
  print 'a:', a
  s.send('admin\n\n')
  b = s.recv(1000)
  print 'b:', b
  c = s.recv(1000)
  print 'c:', c
  </code></pre>
  
  <p>The output of the program is the following:</p>
  
  <pre><code>a: ��
  b: �������� ��!��"��'����#��User:
  c: admin
  
  Password:
  (prompt) #
  </code></pre>
  
  <p><strong>QUESTION:</strong></p>
  
  <p>Why do I need to do double read to receive all the information (<code>print b</code> and  <code>print c</code>) instead of just one read (<code>print b</code>)?</p>