ipython display figure

Peng Yu pengyu.ut at gmail.com
Tue Apr 13 10:10:02 EDT 2021


Hi,

https://www.fuzzingbook.org/html/Grammars.html

I am trying to follow an example on the above page. But it does not
show a figure. Could anybody let me know how to display the figure?

$  ipython3
Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.22.0 -- An enhanced Interactive Python. Type '?' for help.

[ins] In [1]: from fuzzingbook.Grammars import *

[ins] In [2]: from IPython.display import SVG, display

[ins] In [3]: SVG(show_diagram(syntax_diagram_expr(EXPR_GRAMMAR['<term>'][0])))
Out[3]: <IPython.core.display.SVG object>

-- 
Regards,
Peng


More information about the Python-list mailing list