title: Capturing Scapy function output in Python
body: <p>I am trying to capture the output of a scapy function (traceroute) to a string in a python script. I understand I need to pipe this function to stdout (as you do with subproces.call() but unsure how to do this using scapy, is anybody able to provide any assistance? I am new to Python.</p>
  
  <p>Relevent code below.</p>
  
  <pre><code>#!/usr/bin/env python
  from scapy.all import traceroute
  
  traceroute('www.google.com')
  </code></pre>