title: Running a background process with Python
body: <p>I am trying to send GET requests but before starting the requests, I'd like to capture the traffic. Capturing traffic can be done with the command:</p>
  
  <pre><code>dumpcap -i eth0 -f "udp port 53" -w dns.cap
  </code></pre>
  
  <p>in the background. While I capture packets, I need to make some request by sending some URLs. For now, with the code below, it seems my capturing code does not work, I can not even see a dns.cap file in my folder.</p>
  
  <p>What's the problem?</p>
  
  <pre><code>import requests
  import os
  import subprocess
  import urllib
  print "start capturing packets...\n"
  #os.system("dumpcap -i eth0 -f \"udp port 53\" -w dns.cap"
  os.spawnl(os.P_NOWAIT,'dumpcap -i eth0 -f \"udp port 53\" -w dns.cap')
  print urllib.urlopen('http://www.google.com').read()
  #resp = requests.get('http://httpbin.org')
  #resp=requests.get('http://httpbin.org')
  print "ok"
  </code></pre>