Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.28 KB

README.md

File metadata and controls

53 lines (34 loc) · 1.28 KB

gprof2dot_magic

Magic function for gprof2dot to profile any Python statement as a DOT graph in JupyterLab or Jupyter Notebook.

installation

Make sure you've the Python package gprof2dot_magic.

pip install gprof2dot_magic

This will also install its dependencies gprof2dot and graphviz.

It is also important to have the Graphviz software installed.

Apperently you can use conda as such (I don't have conda):

conda install python-graphviz

Without conda

For macOS:

brew install graphviz

For Windows (source):

Note: close your "cmd" in which jupyter lab/notebook is running. Existing running CMD dont catch the new changes in Environment variables

usage

To enable the magic function, first load the gprof2dot_magic module

%load_ext gprof2dot_magic

and then profile any line statement as a DOT graph as such:

%gprof2dot print('hello world')