title: Socket has no attribute AF_INET?
body: <p>I am trying to do a socket programming assignment from one of my textbooks.. UDP connection..</p>
  
  <p>UDPServer.py</p>
  
  <pre><code>from socket import *
  serverPort = 12000
  serverSocket = socket(AF_INET, SOCK_DGRAM)
  serverSocket.bind(('', serverPort))
  print('The server is ready to receive:')
  while 1:
      message, clientAddress = serverSocket.recvfrom(2048)
      modifiedMessage = message.upper()
      serverSocket.sendto(modifiedMessage, clientAddress)
  </code></pre>
  
  <p>UDPClient.py</p>
  
  <pre><code>from socket import *
  serverName = 'localhost'
  serverPort = 12000
  clientSocket = socket(socket.AF_INET, socket.SOCK_DGRAM)
  message = raw_input('Input lowercase sentence:')
  clientSocket.sendto(message,(serverName, serverPort))
  modifiedMessage, serverAddress = clientSocket.recvfrom(2048)
  print (modifiedMessage)
  clientSocket.close()
  </code></pre>
  
  <p>Why am I getting this error when running the Client??</p>
  
  <pre><code>Traceback (most recent call last):
    File "UDPClient.py", line 4, in &lt;module&gt;
      clientSocket = (socket.AF_INET, socket.SOCK_DGRAM)
  AttributeError: type object 'socket' has no attribute 'AF_INET'
  </code></pre>
  
  <p>I looked on this forum and someone had a similar problem, but their problem was that they had their own socket.py file they were importing.  I do not, I am using the standard Python one...</p>
  
  <p>Also this is a sidenote....</p>
  
  <p>Why can't I allow access to Python on Windows 8, it is currently blocked for some reason and  I am the administrator and only account on this computer and when I click Change Settings in Allow Program through Firewall (which is not greyed out so it proves I am admin), nothing appears.. Any help please?</p>