title: saving cProfile results to readable external file
body: <p>I am using <code>cProfile</code> try to profile my codes:</p>
  
  <pre><code>pr = cProfile.Profile()
  pr.enable()
  my_func()   # the code I want to profile
  pr.disable()
  pr.print_stats()
  </code></pre>
  
  <p>However, the results are too long and cannot be fully displayed in the Spyder terminal (the function calls which take the longest time to run cannot be seen...). I also tried saving the results using</p>
  
  <pre><code> cProfile.run('my_func()','profile_results')
  </code></pre>
  
  <p>but the output file is not in human readable format (tried with and without <code>.txt</code> suffix).</p>
  
  <p>So my question is how can I save the profiling results to an external file which is human readable (like in a <code>.txt</code> format with all the words properly displayed)?</p>