title: How to show (as output cell) the contents of a .py file with syntax highlighting?
body: <p>I'm aware of the <code>%load</code> function (formerly <code>%loadpy</code>) which loads the contents of a file (or URL, ...) into a new input cell (which can be executed afterwards).</p>
  
  <p>I'm also aware of <code>%less</code>, <code>%more</code> and <code>%pycat</code>, which show the contents of a file in a <em>pager</em> (which means in the notebook it's shown in the split-window at the bottom of the screen).</p>
  
  <p>Is there a (magic) command to load a file and show its content (with syntax highlighting) in an output cell?</p>
  
  <p>I.e. something like the following but with syntax highlighting of the result:</p>
  
  <pre><code>with open('my_file.py', 'r') as f:
      print(f.read())
  </code></pre>
  
  <p>I want the file content to be stored with the .ipynb file but I don't want it to be executed when I do <em>Cell -> Run All</em>.</p>
  
  <p>Is there a command similar to <code>%psource</code> which shows the source code in an output cell instead of a <em>pager</em>?</p>