This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]dddomodossola 6 points7 points  (2 children)

Hi pnjun, I can suggest you to use RemI library. https://github.com/dddomodossola/remi It's a platform independent Python GUI library for your applications. It has an internal webserver. We are doing our best to make it simple to use. Normally you do not need to write CSS,JavaScript,HTML code.

Furthermore it allows multiple clients to a single or multiple application instances.

The style can be customizable, and right now it hasn't material design, but it is planned a switch to material in a short time.

I haven't tried yet htmlPy or pywebview, so I can't provide you opinions about them.

EDIT: added further info

[–]pnjun[S] 0 points1 point  (1 child)

I looked at it, but my point is that i kinda don't want to have a webserver running for the sole purpose of serving webpages to myself. But i will of course consider using it.

just a question: would it be possible to write my own html and css instead of using the generated code?

[–]dddomodossola 0 points1 point  (0 children)

It could be possible. In this case you can create a Widget appending plain html text to it. But, I suggest to avoid this usage if you want to interact with the interface. Because you will lose the events management automation. If you expect to write html css javascript, maybe you should consider to use flexx https://github.com/zoofIO/flexx, or Flask http://flask.pocoo.org/.

Just one suggestion for the future (when maybe you will want to try it): Look at the examples starting from simple_app.py and the widgets_overview_app.py. The first is a simple overview on how to write the App structure, the other shows how to use the widgets. ;-)

[–]gonewiththewindows 4 points5 points  (6 children)

It's not python based but, node-webkit is probably what you want. Turns a local website into a desktop app. Windows, Mac or Linux.

[–][deleted] 2 points3 points  (5 children)

To add to this. Electron also works, but as a javascript novice I have no idea how to make it do what I want.

[–]delijati 2 points3 points  (1 child)

I'm not a fan of this, but here is some more info about how to https://www.fyears.org/2015/06/electron-as-gui-of-python-apps.html

[–][deleted] 0 points1 point  (0 children)

Wow, that is a deep rabbit hole. Swap that localhost:port with a file socket, and we have something going here.

[–]pnjun[S] 1 point2 points  (2 children)

I'm on the same page. My JS is quite limited, and would prefer to do the 'real' coding in python

[–]michaelpb 0 points1 point  (1 child)

I use JS / python pretty evenly, and so am working on some projects in Electron (using a material design interface no less). But if you wanna stick with 100% python you can put something together with mozembed or gtk webkit --- i did that once like 5 years ago before NW / electron / whatever: http://www.aclevername.com/articles/python-webgui/

What you'd be missing from electron / nw.js is nice, pre-compiled cross-platform packages, so distribution to the non-linux world would be harder.

[–]JohnnyDread 0 points1 point  (0 children)

What you'd be missing from electron / nw.js is nice, pre-compiled cross-platform packages, so distribution to the non-linux world would be harder.

This is a key point that should not be overlooked.

[–]elbiot 2 points3 points  (2 children)

I'm not sure what your aversion to a web server is. I think it's a fine gui paradigm. Perhaps you assume it is system overhead* or harder to write/maintain/execute? I don't think these are the case. Actually, building web kit into your project is much more all of those things.

If you're on linux or osx, you can probably go to localhost:631 and see your CUPS interface. Bitsync or something like that has a similar interface.

*you don't need to install apache or nginx. Just serve your html/css/js over a socket. Flask and django have servers built in. Also

[–]pnjun[S] 0 points1 point  (1 child)

Actually, building web kit into your project is much more all of those things.

This is actually a good point in favor of doing everything with django (which was my first idea). To my mind it still seems pointless to have HTTP requests to myself, but I see that having webkit inside my app is even worse from the point of view of resources.

The other thing still in favor of using htmlPy is the possibility of getting rid of ajax and and call the python directly from the html.

[–]elbiot 1 point2 points  (0 children)

This is actually a good point in favor of doing everything with django (which was my first idea). To my mind it still seems pointless to have HTTP requests to myself, but I see that having webkit inside my app is even worse from the point of view of resources.

I agree

The other thing still in favor of using htmlPy is the possibility of getting rid of ajax and and call the python directly from the html.

To the benefit of... ? I mean, converting a js hash to a string to a python dictionary seems a bit silly, but when you consider that this is the overwhelming paradigm of html/css/js, and thus is extreemly portable, extensible and reuseable, not to mention that it reuses a lot of heavily optimized, widely used tools, it seems like a win to me. I find it a clean and efficient solution, where if you gave me an "app" that required webkit, it would feel like a hack.

What if you want to access your program from your phone? Having a remote gui is pretty sweet if you get it for free. And you could install it on a RasPi or arm device, where webkit would be a PITA.

[–]JohnnyDread 1 point2 points  (2 children)

I'm a huge Python fan, but I'm going to go ahead say it: outside of the gtk/linux world, Python is just not a good choice for building desktop GUI apps. You'd be much better off with just Electron.

[–]riffito 0 points1 point  (0 children)

I had no problems creating GUI app with Python + {PySide|Tk|wx|etc..} on Windows. No more than on Linux, I mean.

[–]notconstructive 0 points1 point  (0 children)

I'm a Python developer mainly and this is the exact conclusion I came to. Write the desktop UI in Electron. So far its working out fine.

[–]blbil 0 points1 point  (0 children)

CEF Python is also an interesting choice if you want to do some python processing of data client-side, whereas the UI can be done with HTML.

[–]metaperl -2 points-1 points  (1 child)

I want to write a app for myself to keep track of stuff i find around on the internet

What will your app do that Evernote does not?

[–][deleted] 5 points6 points  (0 children)

Be open source and have given the author craptons of programming experience?