Python Desktop Application with the Browser as an interface? Python Desktop Application with the Browser as an interface? python python

Python Desktop Application with the Browser as an interface?


Python offers two things that should be of your interest:

  • a web server in the standard library
  • a standartized interface for web applications, called WSGI

So it is relatively easy to add a web interface to your application. For example in Mercurial (the versioning system), you have a command hg serve that launches a web server.

To see python launching a web server, and a WSGI app, just do:

python -m 'wsgiref.simple_server'

You can look at the wsgiref source code or some WSGI tutorial to do a simple app.

After that, you may want to use a web framework (for templating & co), but that is another question...


You could use Pyjamas. It's a port of Google Web Toolkit to Python, which basically means you write in Python and it gets compiled to HTML and JS.


There are plenty of excellent GUI tools for the way you want to do your GUI -- HTML, CSS, and Javascript. If you don't know of any, ask in a separate question with the right tags.

The Python side in such an arrangement should have no GUI of its own, but just run a subclass of the Python's standard library's HTTP server, just serving the HTML, CSS, and JS files, and data via JSON on other URLs that the JS can reach with Ajax techniques, essentially implementing storage and business logi -- so it's far from obvious what "GUI tool" you could possibly want for it?!

Just develop the Python side on its own (e.g. with IDLE, Wingware, SPE, or whatever you like) and the HTML / CSS / Javascript separately, with its own "GUI tool". All that Python will do with those files is statically serve them, after all.

You could be thinking of using some Python side templating, such as Mojo &c, but my recommendation is to avoid that: rather, go with the "thin server architecture" all the way, make the Python side a RESTful server of business logic and storage layers, and do all the GUI work in the browser instead.