I am using cProfile try to profile my codes: pr = cProfile.Profile() pr.enable() my_func() # the code I want to profile pr.disable() pr.print_stats() 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 cProfile.run('my_func()','profile_results') but the output file is not in human readable format (tried with and without .txt suffix). So my question is how can I save the profiling results to an external file which is human readable (like in a .txt format with all the words properly displayed)? Continue reading...