How to write a desktop application that uses HTML and CSS for the user interface and python / perl / c ++ / java for processing?

advertisements

Different languages have different GUI toolkits, but it looks very difficult to achieve attractive user interfaces as good as we can using HTML and CSS with less effort. I don't do my application in javascript as I doubt if it has all the required libraries and I want to do it in python.

How do I use rendering engines like gecko, webkit etc in python? Which one will be more suited to work with python?.Is there any 'only html/css' rendering engine without javascript?

Will it be easy to write event handlers for DOM events and manipulate DOM in python?


update: This is an old answer, nowadays you want to go with an embedded browser in your app (*webkit projects etc.), but at the time of writing, no such technology existed. The answer is still valid if you don't want to add quite a few megabytes to your packaged app though.


Find a lightweight server, or better - embed one in Your application. That's it.

Java has classes for serving http. Python does it well also.

See how mercurial's hg serve works. [python]

I once did a tiny app that served aspell spellcheck via http on localhost in java with the httprequest class. [worked on win and linux]

Create Your application as a server that outputs some html and uses POST to do actions. Do the interface thing in HTML+CSS+JS. Nice and easy.

After running point the user to localhost:somesillyport or trigger opening localhost:somesillyport in a browser.