Converting dot to png in python

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

    pydot needs the GraphViz binaries to be installed anyway, so if you've already generated your dot file you might as well just invoke dot directly yourself. For example:

    from subprocess import check_call
    check_call(['dot','-Tpng','InputFile.dot','-o','OutputFile.png'])
    

提交回复
热议问题