title: Python: Executing windows tracert
body: <p>I'm new to Python and trying to write my first program.</p>
  
  <p>What I'm trying to do is modifying windows <code>tracert</code> command output by putting a date on the output.</p>
  
  <pre><code>c:\Python\Codes&gt;more tr.py
  import os
  import time
  print (time.strftime("\nDate: %d %B %Y"))
  os.system('tracert')
  
  c:\Python\Codes&gt;tr.py 127.0.0.1
  
  Date: 09 March 2018
  
  Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout]
                 [-R] [-S srcaddr] [-4] [-6] target_name
  
  Options:
      -d                 Do not resolve addresses to hostnames.
      -h maximum_hops    Maximum number of hops to search for target.
      -j host-list       Loose source route along host-list (IPv4-only).
      -w timeout         Wait timeout milliseconds for each reply.
      -R                 Trace round-trip path (IPv6-only).
      -S srcaddr         Source address to use (IPv6-only).
      -4                 Force using IPv4.
      -6                 Force using IPv6.
  
  c:\Python\Codes&gt;
  </code></pre>
  
  <p>However, the <code>tracert</code> command in Python code was not executed correctly.</p>
  
  <p>This is what I'm expecting.</p>
  
  <pre><code>c:\Python\Codes&gt;tr.py 127.0.0.1
  
  Date: 09 March 2018
  
  Tracing route to 127.0.0.1
  over a maximum of 30 hops:
  
    1    &lt;1 ms    &lt;1 ms    &lt;1 ms  127.0.0.1
  
  Trace complete.
  
  c:\Python\Codes&gt;
  </code></pre>
  
  <p>Please let me know how to fix this. Thanks.</p>