mot (symmys) wrote,

A python GUI without classes?

I'm a pygtk programmer (I wrote GNOME Sudoku and Gourmet Recipe Manager) and was recently excited to see a simple podcast-reader called gpodder written in pygtk.

Anyway, I took a look at the source to try to make some quick fixes, and found myself feeling completely disoriented. After a minute, I realized what was strange — there were no classes.

I've always used an OO style in python (I think that's the right bit of jargon). For the GUI part of my app, I tend to have a class for any chunk of the interface (for a simple app like this one, that would be just one class), and then classes for the main functions. For a pod-cast retriever, I might imagine something like:

  • FeedFetcher (handle URL fetching)

  • Prefs (handle configuration)

  • MainApp (handle GUI)

Is this what most python programmers would do, or is a completely classless style commonplace? I'm self-taught, so I don't know what's normal, but I never read a pygtk example that used only functions, so I wanted to ask if this was a standard style of programming I didn't know about or something.


  • Moving...

    So I'm experimenting with trying to blog again. Here's a new, slightly-more-grown-up blog.

  • Youtube, Politics, Immigration

    So, I still don't know who I want to vote for when the primary rolls around, but I'm starting to feel like I should have some more informed opinions.…

  • Daughter

    As of 9:40 11/13, I am now the father of a 6lb 7oz baby girl. Mom&baby are well. If you wanted pictures and didn't get an e-mail, ping me and I'll…

  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.