Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use HTML + Javascript to build a python GUI?

Tags:

I have been experimenting with Appcelerator Titanum yesterday and I think it's cool when it comes to Javascript.

Python features on Appcelerator Titanum are so limited (can't use some modules for example).

My question is How can I use html & javascript as a GUI tool for a real python application ?

I am running windows 7 and i was thinking of using webkit for that purpose but couldn't know how to work with it in python.

I am planning to make a standalone executable using py2exe as I don't know if the users always have python and the appropriate modules installed.

like image 677
Lettuce Avatar asked Oct 27 '10 14:10

Lettuce


1 Answers

If you're after webkit bindings for Python, look at PyQt, which includes Webkit, as well as wxWebkit (http://wxwebkit.wxcommunity.com/) if you're using wxWidgets. This lets you embed webkit in a Qt or Wxwidgets app so that you won't have to go through a browser.

If you do use this, then you can either use a web server in Python, like others have mentioned, or you can control the Webkit control directly (though I'm not sure how practical this is).

Beyond that, there's also Pyjamas Desktop (http://pyjs.org/), which lets you use Pyjamas to build the application, then run it.

like image 137
li.davidm Avatar answered Oct 29 '22 00:10

li.davidm