import socket
from socket import *
conn = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.ntohs(3))
I'm facing this error:
AttributeError: type object 'socket' has no attribute 'socket'
If you import all library don't need to name library before method:
from socket import *
socket.socket # AttributeError: type object 'socket' has no attribute 'socket'
from socket import *
socket # <class 'socket.socket'>
or maybe :
import socket
socket.socket # <class 'socket.socket'>
import socket
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
print("Socket is created")
I fixed these changes my codes and work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With