While the terminal output of pyinstrument certainly is very nice, you may be able to get a bit more interactivity going by using it's html output instead. You can learn how to configure pyinstrument for this by checking the command line documentation.
pyinstrument --help
Here, you can confirm that the renderer
can be set via -r
. This is what we'll use.
Html Output
To get the report in html you can run:
pyinstrument -r html path/script.py