title: send SCPI command through python socket module
body: <p>I am using python's socket module to send a simple SCPI command to my Keysight device, but I get a blank response. Does anyone know what I am doing wrong?</p>
  <p>Here is my simple script.</p>
  <pre><code>import socket
  s = socket.socket()
  print(&quot;connecting&quot;)
  s.connect((&quot;192.168.25.7&quot;,5024))
  print(&quot;sending&quot;)
  s.settimeout(10)
  s.send(&quot;*IDN?\n&quot;)
  print(s.recv(2048))
  </code></pre>
  <p>I expect this script to return</p>
  <pre><code>➜  ~ python hack_na.py
  connecting
  sending
  Agilent Technologies,E5063A,MY54100104,A.03.00
  ➜  ~ 
  </code></pre>
  <p>But if I run the script, I get this output instead.</p>
  <pre><code>➜  ~ python hack_na.py
  connecting
  sending
  
  ➜  ~ 
  </code></pre>
  <p>I can confirm that I get the desigred output with telnet.</p>
  <pre><code>➜  ~ telnet 192.168.25.7 5024
  Trying 192.168.25.7...
  Connected to 192.168.25.7.
  Escape character is '^]'.
  
  SCPI&gt; *IDN?
  Agilent Technologies,E5063A,MY54100104,A.03.00
  SCPI&gt;
  telnet&gt; Connection closed.
  </code></pre>
  <p>Thank you all in advance.</p>