title: Can Python be made to generate tracing similar to bash's set -x?
body: <p>Is there a similar mechanism in Python, to the effect <code>set -x</code> has on bash?</p>
  
  <p>Here's some example output from bash in this mode:</p>
  
  <pre>
  + for src in cpfs.c log.c popcnt.c ssse3_popcount.c blkcache.c context.c types.c device.c
  ++ my_mktemp blkcache.c.o
  +++ mktemp -t blkcache.c.o.2160.XXX
  ++ p=/tmp/blkcache.c.o.2160.IKA
  ++ test 0 -eq 0
  ++ echo /tmp/blkcache.c.o.2160.IKA
  + obj=/tmp/blkcache.c.o.2160.IKA
  </pre>
  
  <p>I'm aware of the Python <a href="http://docs.python.org/library/trace.html" rel="noreferrer"><code>trace</code></a> module, however its output seems to be extremely verbose, and not high level like that of bash.</p>