saving cProfile results to readable external file
Clash Royale CLAN TAG #URR8PPP saving cProfile results to readable external file I am using cProfile try to profile my codes: cProfile 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). cProfile.run('my_func()','profile_results') .txt 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)? Basically cProfile output is a binary file. Why you can't use dump_stats + pstats.Stats ? – Danila Ganchar 1...