5

I'm used to program with Python and GTK using pygtk library.

I feel like my programs are not well separated according to MVC model. I think following a framework it would help me to design better desktop applications.

I'd like to know which Python MVC framework for desktop apps you're using and why.

yannis
  • 39,647
Murilo
  • 51

2 Answers2

11

You don't need a framework. Create a class called Model, another one called View and a third one named Controller and start coding. Put all of the UI code in the View class, your data structures in the Model class, and make sure they communicate only via the Controller. I think going through that exercise might teach you a lot.

I'm not trying to be funny here, it's really not very complicated, and doesn't require a fancy framework.

Bryan Oakley
  • 25,479
2

first, I think Qt, and even it's Python bindings are way better structured than GTK; so you could first try it.

second, it seems you're slightly confused by the MVC buzzword. It was originally defined as a modular architecture for GUI applications; unfortunately, there's a completely different layered architecture for Web apps also called MVC.

Maybe you feel your desktop apps are not very MVC because there not very web MVC, but they might be very GUI MVC nonetheless.

Javier
  • 9,958