Converting dot to png in python

前端 未结 7 1974
轻奢々
轻奢々 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:36

    Load the file with pydot.graph_from_dot_file to get a pydot.Dot class instance. Then write it to a PNG file with the write_png method.

    import pydot
    
    (graph,) = pydot.graph_from_dot_file('somefile.dot')
    graph.write_png('somefile.png')
    
    0 讨论(0)
提交回复
热议问题