0

I want to generate Wireshark/tcpdump traces at the end of a Python script, in a cap file.I looked at libcap for example but when executing the command, the script is stopped. How can I generate a cap file without suspending my intial python script? Thank you

farfalla
  • 173
  • 1
  • 1
  • 10

1 Answers1

0

You can start command in background:

import os
os.spawnl(os.P_NOWAIT, 'your_command')

Or:

import subprocess
process = subprocess.Popen(['your_command', 'arg1', 'arg2'])
romsuhov
  • 153
  • 2
  • 8