views:

309

answers:

6

I've been a Ruby on Rails developer for a few years now and until Ruby on Rails have never been exposed to the conventions and design patterns that I've now grown to love and appreciate.

I would like to start getting into building desktop applications with Python in a Gnome environment. What would be a beneficial resource to get started? I would like to follow MVC and use test driven design.

One project I am aware of in the python-gtkmvc which I will be looking at.

Aside from python-gtkmvc, are there are any other decent frameworks for building desktop applications with Python or specific design patterns or proven application structuring techniques? In regards to testing, what are the ideal testing suites? Is PyUnit the standard? Is GUI testing prevalent? PyGTK versus wxPython? Any ORM like solutions for working with data?

Finally, is there a repository I could take a look at of a desktop Python application that's fully tested and well done?

A: 

Besides those you mention, there's PyQt.

I'm not aware of any good ORM used in desktop apps.

MVC is in fact, a GUI app design architecture; it was (crudely) adapted to web apps, but since the original formulation has no relation to (traditional) web architecture, it was redefined, so what's now currently known as MVC is very different to the original MVC.

some GUI libraries use a simplification of MVC, commonly losing the controller, or merging it with the views. its more appropriate of modern design, since most of what was the controller now is simply the message/signals/event passing infrastructure, and the rest is too tightly coupled to the interaction, so it's better to merge with the view.

Javier
A: 

For a Python ORM, you can take a look at SQLObject.

Joe L.
I used SQLObject for a while but sooner than later found it rather lacking in terms of querying flexibility. SQLAlchemy served me better, although it took longer to learn.
pi
A: 

Any reasons for not wanting to build desktop apps with Ruby?

Mark Lubin
You bring up a great point. I would say half the reason is to finally dive into Python which I can then extend to the web with Django. The other half is to stay in line with much of the standards of that of Ubuntu, which I beleive Python is the go to lang. Not leaving Ruby behind by any means.
mwilliams
+3  A: 

My first question is whether you have done much work in Python before. Are you already familiar with standard Python idioms as well as the module library? If not, take a look a couple of the threads out there on Stack Overflow. They have invaluable resources on learning Python standard practice (and all the cool things you can do).

In terms of good GUI APIs for Python, there is a nice little thread on this very topic.

If you would like to get a look at a well used Python program's source code, I might recommend the original BitTorrent client (note: link is to the Linux source), as it is both written in Python and used by a massive user base.

You might also take a look at this thread regarding a single Python executable on each of Windows/Mac/Linux.

akdom
I have not done any professional Python work, everything up until this point has been hobby or experimenting. I have been browsing SO threads for Python idioms and design patterns that may prove useful as well as selecting an editor that I'll be most productive with.
mwilliams
+1  A: 

For a nice Python ORM, check out Elixir. It's a declarative layer on top of SQLAlchemy based on the Active Record pattern, and should feel very familiar to you coming from Rails.

Chris Dolan
A: 

For unit testing, there are already two modules in the standard library, unittest and doctest. Many people use nose or py.test to supplement or replace unittest (both are more concise and extensible).

unittest was updated in Python 2.7 to add better discovery, comparisons, and cleanups; to get those new features in earlier versions, get unittest2.

The testing-in-python mailing list is where the gurus hang out.

ianmclaury