Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Desktop Application with the Browser as an interface?

I want to create an application that runs on the users computer, a stand-alone application, with installation and what-not, but I want the interface to be a browser, either internal and displayed as an OS window or external accessible using the browser (i.e. some http server).

The reason would be because I know a little about Python, but I think I can manage as long as I have some basic roots that I can use and manipulate, and those would be HTML, CSS, and Javascript.

I've yet to find a good GUI tool which I can use, and always abandon the idea after trying to mess around and eventually not getting anything.

like image 281
Eli Avatar asked Sep 09 '25 21:09

Eli


2 Answers

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...

like image 179
Piotr Lesnicki Avatar answered Sep 12 '25 11:09

Piotr Lesnicki


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.

like image 32
Matthew Flaschen Avatar answered Sep 12 '25 12:09

Matthew Flaschen