How does one distribute Tkinter or Qt GUI apps Developed in Python

Ben Finney ben+python at benfinney.id.au
Wed Dec 16 20:20:39 EST 2015


Bruce Whealton <futurewavewebdevelopment at gmail.com> writes:

> What seems to be blatantly missing is how this would be distributed.

Distributing programs so that recipients can run them is an ongoing
problem.

Operating systems arenecessarily involved, and since not every recipient
uses the exact same configuration of the exact same version of the exact
same operating system, the means of getting your program installed and
working on their computer will differn significantly.

> In the first mentioned tutorial from Lynda.com the Tkinter app was
> related to a web page. However, the browser cannot run Python Bytecode
> or Python Scripts.

Web applications are attractive for developers in large part because web
standards are hard-won oases of compatibility across different operating
systems.

It is no accident that operating system vendors (Microsoft, Apple,
Google, etc.) keep trying to carve out attractive incompatible features
and areas of their system, to ensure some applications using those
non-standard features will only run smoothly on the operating system
controlled by that vendor.

> Surely, one is going to want to create GUI apps for users that are not
> Python Developers.

Indeed, and toolkits like Tkinter make this refreshingly easy to do in a
way that works across all mainstream operating systems today.

What is not standardised is installation of software for end users.

> I would want to package in some way so that when launched, it installs
> whatever is needed on the end user's computer. How is this done? 

This is the “bootstrap” problem: a Python program is only useful once
there is a Python interpreter installed and working on the recipient's
system. You still need to get the appropriate version of Python
installed on that recipient's operating system.

You'll need to know your target audience, make decisions about the set
of operating systems you want to support, and build a package for each
one.

> Are there common practices for this?

Common to all mainstream operating systems? No, installation of software
is one major area that makes operating systems incompatible.


For GNU+Linux systems: Up-to-date Python is easily installed as a
dependency of your package. Target the version(s) of Python you know
your recipients will have, and declare a dependency in the operating
system package you make.

For OS X: There is an old, minimal Python installation, which is
probably too old for you to target. I am not aware of a good dependency
resolution system; you'll need to get the latest stable Python onto the
recipient's system with their help.

For iOS: I'm not aware of a good way to install Python programs on iOS.

For Android: There is a decent dependency system, but again I'm not
aware of a good standard way to have a Python program install onto
Android.

For MS Windows: There is definitely no good dependency resolution system
for you to use. You'll need to bundle a Python interpreter with your
program as a single installable file. This makes your program much
larger and redundant with any other such program on the system; this is
what Microsoft has doomed developers to work with.

-- 
 \      “If we have to give up either religion or education, we should |
  `\              give up education.” —William Jennings Bryan, 1923-01 |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list