title: Why is my stdout interfering with my webpage in python?
body: <p>Really simple code that just fires one pcap (packet) using scapy, </p>
  
  <p>If I just want to do simple cgi-bin POSTS to myself to run a set of 10 easy tests why is this just kicking back as text (rather than a website).  If I comment out the line </p>
  
  <pre><code>sendp(a, iface="em1")
  </code></pre>
  
  <p>Then the below code actually generates the website fine... but it won't actually send the packet, I imagine this is something with stdout.... suggestions are welcome!</p>
  
  <pre><code>#!/usr/local/bin/python
  
  from scapy.all import *
  #import v6tester_main
  
  print "Content-type:text/html\r\n\r\n"
  print '&lt;html&gt;'
  print '&lt;head&gt;'
  print '&lt;title&gt;NPD Automation Tool - GCT-USG&lt;/title&gt;'
  print '&lt;/head&gt;'
  print '&lt;body&gt;'
  print '&lt;font&gt; NPD Automation Tool &lt;/font&gt;'
  
  a = Ether() / IP() / IPv6() / ICMPv6EchoRequest()
  sendp(a, iface="em1")
  
  print '&lt;br&gt;'
  print '&lt;font&gt;End of Test&lt;/font&gt;'
  print '&lt;/body&gt;'
  print '&lt;/html&gt;'
  </code></pre>
  
  <p>If I view source I see this-></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;NPD Automation Tool - GCT-USG&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;font&gt; NPD Automation Tool &lt;/font&gt;
  
  Sent 1 packets.
  &lt;br&gt;
  &lt;font&gt;End of Test&lt;/font&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>