Converting dot to png in python

前端 未结 7 2029
轻奢々
轻奢々 2020-12-02 22:58

I have a dot file generated from my code and want to render it in my output. For this i have seen on the net that the command is something like this on cmd

7条回答
  •  感情败类
    2020-12-02 23:18

    You can use graphviz:

    # Convert a .dot file to .png
    from graphviz import render
    render('dot', 'png', 'fname.dot')
    
    # To render an existing file in a notebook
    from graphviz import Source
    Source.from_file("fname.dot")
    

提交回复
热议问题