title: Socket gives me error when i try to connect -python
body: <p>im trying to learn about sockets and i cant manage to connect to the ip,port.
  this is the script i got:</p>
  <h1>stian's socket test tool</h1>
  <pre><code>import socket
  
  print &quot;send request to website to check if sockets work right&quot;
  ip = raw_input(&quot;website ip: &quot;)
  port = raw_input(&quot;website port: &quot;)
  socket.connect(ip, port)
  tosend = &quot;this is a test&quot;
  currVal = 0
  while currVal &lt; 1:
      socket.send(tosend)
      print &quot;1 sockets sent...&quot;
      currrVal += 1
  print &quot;Done sending sockets. This hopefully worked&quot;
  </code></pre>
  <p>is anything wrong with the python code?
  does this only work with ipv4 or ipv6? or does it work with both?</p>
  <p><strong>ERROR IM GETTING:</strong></p>
  <pre><code>C:\Users\Swipper\Documents\Python\sockets&gt;sock.py
  send request to website to check if sockets work right
  website ip: 127.0.0.1
  website port:
  Traceback (most recent call last):
    File &quot;C:\Users\Swipper\Documents\Python\sockets\sock.py&quot;, line 8, in &lt;modu
  le&gt;
      socket.connect(ip, port)
  AttributeError: 'module' object has no attribute 'connect'
  </code></pre>
  <p>hope someone know the answer.</p>
  <p><strong>PS: I Use python 2.7!</strong></p>
  <p>-stian</p>