Creating A Socket In Python
import socket import sys HOST = '' # Symbolic name meaning all available interfaces PORT = 8888 # Arbitrary non-privileged port s = socket.socket(socket.AF_INET, socket.SOCK_ST
Solution 1:
You called your file socket.py
rename it to somethng like my_socket.py
and delete the socket.pyc
file in the same directory.
You are trying to import from your socket.py
file not the actual socket module, python checks the local directory first.
Post a Comment for "Creating A Socket In Python"