title: Python socket - how can i connect to a different pc
body: <p>How can i connect to a different pc using socket module in python? My code currently gives me 2 errors. The first error is:</p>
  <pre><code>ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it.
  
  line 7, in &lt;module&gt;
      s.connect((target, 80))**
  </code></pre>
  <p>Here is my code:</p>
  <pre><code>import socket
  
  target = '192.168.1.0' #i convered the full ip
  
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  
  s.connect((target, 80))
  s.send('HEAD / HTTP/1.1\nHost: ' + target + '\n\n')
  
  print (s.recv(1024))
  s.close()
  </code></pre>