How do i stop the following thread?
from threading import Thread
from scapy.all import sniff
class SnifferThread(Thread):
def __init__ (self,filter):
Thread.__init__(self)
self.filter = filter
def run(self):
sniff(filter=self.filter, prn=self.pkt_callback, store=0)
def pkt_callback(self,pkt):
print pkt.sprintf('%TCP.payload%')
if __name__ == '__main__':
sniffer = SnifferThread("tcp port 80")
sniffer.start()
#here i will make a GUI using PyQt4
Should i kill it somehow? If i do kill it will the memory be cleaned?