I am trying to pass the value from an executing script to another file. Capture.py is the executing script. The script is running and will end only when KeyboardInterrupt.
#capture.py
def default(interface):
""" Capture packets """
for ts, pkt in pcap.pcap(interface):
return ts, pkt
while True:
return default(interface)
I want another script that can get the value of ts, pkt when executed. And while terminating this script, the capture.py needs to be still running.