GUIs - A Modest Proposal

Michael Torrie torriem at gmail.com
Mon Jun 7 23:30:59 EDT 2010


On 06/07/2010 09:19 PM, rantingrick wrote:
> On Jun 7, 5:05 pm, Michael Torrie <torr... at gmail.com> wrote:
> 
>> Thus for Python to really be successful in a broader sense, we need
>> good, solid, bindings for Cocoa, or Windows forms (whatever they are
>> using these days), as well as the most popular windows toolkits.  We
>> don't need another Swing.  As someone else mentioned, web-based
>> interfaces are increasingly important.  That means you have to write
>> your apps in a modular way that separates the GUI from the business
>> logic.  That way you can develop a nice GUI app and then, when there is
>> demand, give it a web front end.
> 
> Micheal makes a good point about the future web based interfaces. The
> momentum is building fast for this type of thing and GUI may be
> obsolete very soon. What options do we have in this arena? If were
> going to move forward we should at least move in the right direction.
> Seems that web based would help to satisfy the size requirement at
> least. Pythoninic API, hmm, ain't seen one yet? Anybody have
> suggestions...?

What I do is to make the bulk of my code in modules that I can import
into a web-based front end (say in Django), or in a GTK-based front-end
or what have you.  In other words everything is abstracted as best I can
to be independent of the GUI.  If I was writing a file manager, for
example, I'd abstract all the operations that read and wrote
directories, performed file ops, etc, so that the frontend code just
simply calls my high-level functions and methods.  Then it becomes much
easier to build a PyGTK front end, or PyQt frontend.  There's obviously
a certain amount of work that goes into the frontend, but not quite as
much as if I'd glommed everything together.

Another tactic we're trying at my work is to build web apps in Django
and then ensure that all of our apps export business logic over XMLRPC,
so we can write non-web frontends to our apps, or even scripts.  I think
RPC-like mechanisms are the key to an agile app, at least if the app is
a network-oriented app to begin with.




More information about the Python-list mailing list