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.
Here, you can confirm that the
renderer can be set via
-r. This is what we'll use.
To get the report in html you can run:
pyinstrument -r html path/script.py