如何在 Tkinter 中实现 MVC 模式
我需要一个基本示例,其中 MVC 模式与 Python TK 一起使用。我有一些使用 Tkinter 的代码,但是我想使用 MVC 模式对其进行转换。
I need a basic example where MVC pattern is used with Python TK. I have some code using Tkinter, however I would like to transform it using the MVC pattern.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(2)
心凉怎暖2024-12-15 08:58:45
我也会推荐这本书,作者介绍了如何以模型视图方式构建 Tkinter 应用程序:
https://www.packtpub.com/application-development/tkinter -gui-应用程序开发-hotshot
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我知道这已经很老了,但我能够找到一些使用 Tk 和 wxPython 的 MVC 模式的不错的例子,希望它们能为任何遇到这个问题的人提供一些帮助。
wxPython: http://wiki.wxpython.org/ModelViewController
Tk:
http://tkinter.unpythonic.net/wiki/ToyMVC该网站已不再存在,因此我将代码托管在此处的要点上。
I know this is quite old but I was able to find some decent examples using the MVC pattern with both Tk and wxPython, hopefully they provide some help for anyone stumbling upon this question.
wxPython: http://wiki.wxpython.org/ModelViewController
Tk:
http://tkinter.unpythonic.net/wiki/ToyMVCThis website no longer exists so I've hosted the code on a Gist here.