0

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.

1 Answer 1

0

I think you need to think about saving what you are trying to return into a file or if, as I suspect, this is a scapy script then you need to make use of callbacks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.