在MainWindow类中,定义了多个方法时,缺少了一个类方法的声明。应该在类定义前加上"@classmethod"。例如:

@classmethod
def show_arp_page(cls):
    cls.arp_page = tk.Toplevel(cls.root)
    ArpDetectorPage(cls.arp_page)

此外,MainWindow类中的方法中,有些方法中的变量名与类属性名

import tkinter as tkimport osimport sysimport timeimport threadingimport netifacesfrom scapyall import from scapylayersl2 import ARPfrom tkinter import messageboxfrom scapylayersl2 import getmacbyipfr

原文地址: https://www.cveoy.top/t/topic/frHw 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录