title: Python: Indent print output from class
body: <p>How can I indent the print output on the command line from a class that is called? I can't edit the class file to add tabs to each print().</p>
  
  <p>So I would call the imported class in mypythonthing.py:</p>
  
  <pre><code>print('Calling class')
  MyClass()
  </code></pre>
  
  <p>All the print output would then be indented, or have something prepended to it.</p>
  
  <p>e.g.</p>
  
  <pre><code>$ python mypythonthing.py
  $ Running your python script...
  $ Calling class
  $    &gt; The print output from MyClass is indented
  $    &gt; Exiting MyClass
  $
  </code></pre>