graphviz .dot输出tkinter
我创建了一个Python程序的一部分,该程序从用户中获取输入并生成一个.dot文件来绘制与某些输入相对应的有限自动机图。该程序的GUI是在TKINTER库上构建的。
我想知道是否有一种方法可以将.dot文件转换为png文件或可以在TKInter窗口中显示的内容,因为我知道的唯一方法需要CMD中的明确命令:
dot output.dot -Tpng -o image.png
谢谢您的时间
I have created part of a python program which takes input from user and generates a .dot file to draw a finite automata graph corresponding to certain inputs. The GUI of the program is built on the Tkinter library.
I would like to know if there is a way to convert the .dot file into a PNG file or something I can display in a Tkinter window, as the only way I know of requires explicit commands in CMD:
dot output.dot -Tpng -o image.png
Thank you for your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
subprocess.run(subprocess.run( )
。You can run arbitrary commands from within Python with
subprocess.run()
.