graphviz .dot输出tkinter

发布于 2025-01-30 04:43:18 字数 240 浏览 2 评论 0原文

我创建了一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别忘他 2025-02-06 04:43:19

You can run arbitrary commands from within Python with subprocess.run().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文