[BangPypers] What are you using for developing desktop GUIs?

Dhananjay Nene dhananjay.nene at gmail.com
Fri Sep 27 17:25:59 CEST 2013


On Fri, Sep 27, 2013 at 7:21 PM, Sriram Karra <karra.etc at gmail.com> wrote:
> On Fri, Sep 27, 2013 at 7:06 PM, Dhananjay Nene <dhananjay.nene at gmail.com>wrote:
>
>>
Overall background: I write desktop apps but not in python, I do write
the backends in python. So my desktop awareness is more generic. I did
try wxPython years ago but never took it to reasonable stage and not
to production either.

>> a) What are sample installers one could use to install web based apps
>> on user's machine (users more often than not use simple wizards to
>> install apps)
>>
>
> It is a standard python application with a web server included - the server
> and client are on the same machine, that is all. So there are no special
> requirements, per se.

In most cases I find users want a installer. Basically just point and
click. So if there is no installer where a user selects a install
directory and presses a button called install (and perhaps a couple of
app specific items), there's a huge support cost due to users being
not able to install apps successfully. I presume what you mean by a
standard python application, but if it means a user having to install
python if not installed, create a virtualenv, run pip install, create
desktop shortcuts to start / stop servers, in most cases it is very
very unlikely to work with lay end users. (Much of this applies to
desktop based apps as well).
>
> b) Do you start up app by default ? If so can the installer integrate
>> into the native service system to start / stop the webapp?
>>
>
> I have not done this. The invocation is explicitly on demand. It is trivial
> to protect against multiple invocations of the program, and to support a
> 'Exit Program' action on the front end that will shut down the web server.

Ok. I've never tried this. Perhaps it is trivial. But shutting down a
server even as the controller is processing a request may
"potentially" be hard. Perhaps one could set a timeout to allow the
request to complete and then trigger a shutdown.
>
>
>> c) If you do not start app by default, how easy is it for users to
>> start and stop the webapp.
>>
>
> It is as easy as any other program. To give you an example, take a look at
> a sample: https://github.com/skarra/PRS

Ok, I am not particularly familiar with how the windows integration
works so am not able to quickly figure it out.
>
> Here I require that the user have python installed. The main python driver
> is called prs.pyw (for Windows) - the user has to double click on that
> file. For use on other systems I have a symlink the py file to the pyw.

The difficulty is that the user may have multiple versions of python
installed and/or his default version may not be compatible with the
one you want. Plus virtualenv specific for your app will need to be
configured.
>
>
>> d) Do you offer any integration in the system tray to shut down the
>> app if the user is in a memory hungry situation and would prefer to
>> shutdown your app to conserve memory
>>
>
> I have not tried this. But I am sure the answer to such question lies in
> platform specific libraries. For e.g. on Windows Pywin32 can do wonders.
> But again, these issues have to be solved regardless of what widget library
> you use, or you go the tornado route.

You did mention reusable code. Service integration, system tray
integration etc. are all cross platform issues that are introduced
when you install a web app on a desktop (desktop apps usually do not
have these issues since they exit when user presses exit, and usually
always keep an application window open for the user to find the exit
button from. So there's still a few skills you need to pick up and in
this case they are platform specific (at least I am not aware of
platform neutral solutions)

You also open yourself up to cross browser portability issues. Also
having to deal with older vs newer browsers (IE6??). Which if you were
using a standard widget library wouldn't have worried you.

>
>
>> e) Do you undergo security audits ? If so, what issues come up in the
>> discussions that wouldn't have come up in pure desktop apps ?
>>
>
> I do not do this stuff commercially. So have not had to deal with this. But
> *again* - no one needs to even bother that this is a 'webapp' - the entire
> thing runs on your desktop and will work even without an internet
> connection.

At the minimum you have an open port. You probably need to restrict
traffic only from localhost. In addition you need to worry about SQL
injection, XSS, XSRF, and a bunch of other alphabet soup combinations.
Desktop apps don't need to worry about many of these (though they can
fall prey to some of these as well, its much harder to write an
insecure desktop app than an insecure webapp).

I don't mean to suggest it is wrong or inappropriate to use webapps as
desktop apps. But just wanted to point out there are a whole bunch of
counter issues as well that need to be dealt with.

Dhananjay


More information about the BangPypers mailing list