Reputation: 1
Here is the error that it is showing
I use windows 7 running python 3.8.6. But it is showing that socket module does not have socket.bind.
Upvotes: 0
Views: 37
Reputation: 31
you must create socket object first. then you can call socket.bind which state the 'socket' or 's' here as an object, as this example
import socket
HOST = '' # Symbolic name meaning all available interfaces
PORT = 50007 # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
Upvotes: 1
Reputation: 1083
Try socket.socket.bind
instead.
Or change import to from socket import socket
Upvotes: 0