Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100542 > unrolled thread
| Started by | Bruce Whealton <futurewavewebdevelopment@gmail.com> |
|---|---|
| First post | 2015-12-16 16:03 -0800 |
| Last post | 2015-12-17 08:28 -0800 |
| Articles | 10 — 9 participants |
Back to article view | Back to comp.lang.python
How does one distribute Tkinter or Qt GUI apps Developed in Python Bruce Whealton <futurewavewebdevelopment@gmail.com> - 2015-12-16 16:03 -0800
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python Christian Gollwitzer <auriocus@gmx.de> - 2015-12-17 01:29 +0100
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python Rick Johnson <rantingrickjohnson@gmail.com> - 2015-12-16 16:45 -0800
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python Denis Akhiyarov <denis.akhiyarov@gmail.com> - 2015-12-16 17:21 -0800
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-12-17 13:58 +0000
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python wxjmfauth@gmail.com - 2015-12-17 07:21 -0800
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python Ben Finney <ben+python@benfinney.id.au> - 2015-12-17 12:20 +1100
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python Michiel Overtoom <motoom@xs4all.nl> - 2015-12-17 12:01 +0100
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-12-17 15:30 +0000
Re: How does one distribute Tkinter or Qt GUI apps Developed in Python wxjmfauth@gmail.com - 2015-12-17 08:28 -0800
| From | Bruce Whealton <futurewavewebdevelopment@gmail.com> |
|---|---|
| Date | 2015-12-16 16:03 -0800 |
| Subject | How does one distribute Tkinter or Qt GUI apps Developed in Python |
| Message-ID | <d8560cde-5ccb-4b91-b60c-adc8c1cb836c@googlegroups.com> |
I watched one training video that discussed Python and Tkinter. Like many similar tutorials from online training sites, I was left scratching my head. What seems to be blatantly missing is how this would be distributed. 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. Surely, one is going to want to create GUI apps for users that are not Python Developers. I would not think to ask someone to install Python on their system and make sure it is added to the path. Maybe it is not so hard for the non-technical, average 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? Are there common practices for this? Thanks, Bruce
[toc] | [next] | [standalone]
| From | Christian Gollwitzer <auriocus@gmx.de> |
|---|---|
| Date | 2015-12-17 01:29 +0100 |
| Message-ID | <n4svfl$chr$1@dont-email.me> |
| In reply to | #100542 |
Am 17.12.15 um 01:03 schrieb Bruce Whealton: > I watched one training video that discussed Python and Tkinter. Like many similar tutorials from online training sites, I was left scratching my head. > > What seems to be blatantly missing is how this would be distributed. 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. > > Surely, one is going to want to create GUI apps for users that are not Python Developers. I would not think to ask someone to install Python on their system and make sure it is added to the path. Maybe it is not so hard for the non-technical, average 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? > Are there common practices for this? > Thanks, > Bruce > On option is pyinstaller or py2exe, which converts a Python script + dependencies into a single file (single directory) executable. Sometimes you must give them hints what to include, but in general it works well. It may create very large packages (if you include numpy/scipy/matplotlib, you'll end up with ~60 MB) Christian
[toc] | [prev] | [next] | [standalone]
| From | Rick Johnson <rantingrickjohnson@gmail.com> |
|---|---|
| Date | 2015-12-16 16:45 -0800 |
| Message-ID | <ffc43f4a-bea3-40a0-88a5-aeefb54fc652@googlegroups.com> |
| In reply to | #100542 |
On Wednesday, December 16, 2015 at 6:03:55 PM UTC-6, Bruce Whealton wrote: > Surely, one is going to want to create GUI apps for users > that are not Python Developers. I would not think to ask > someone to install Python on their system and make sure it > is added to the path. Maybe it is not so hard for the non- > technical, average 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? Are there common practices for this? Your assumptions are correct! In fact, in a language that was "supposedly" designed to be an "applications language" (eat your heart out D'Aprano!!!), one would think that distributing apps would not only be obvious, but also intuitive! ALAS, THE CRUEL REALITIES OF INTERPRETED LANGUAGES SLAPS YOU IN THE PASTEY WHITE FACE! Unlike a true "applications language", like say, um, *JAVA*, one cannot simply compile an executable and distribute it in a teeny tiny binary form, no, with Python, the end user must either (1) have Python on his machine already, (2) download Python, or (3) you must package a Python interpreter along with your script (and dependencies) -- which will end up being a very large file just to run (what is in most cases) a very small script. BOO-HISS! But the good news is that, Python ships on many machines already. But of course, you're seeking more consistency in your distribution QA than the "wild guess" and the fickle nature of "lady luck". Many 3rd party libraries exist to solve your distribution issue. Google probably knows about all (or at least most) of them.
[toc] | [prev] | [next] | [standalone]
| From | Denis Akhiyarov <denis.akhiyarov@gmail.com> |
|---|---|
| Date | 2015-12-16 17:21 -0800 |
| Message-ID | <aab438cb-56ff-4163-b877-1616859ff1e2@googlegroups.com> |
| In reply to | #100545 |
On Wednesday, December 16, 2015 at 6:45:50 PM UTC-6, Rick Johnson wrote: > On Wednesday, December 16, 2015 at 6:03:55 PM UTC-6, Bruce Whealton wrote: > > > Surely, one is going to want to create GUI apps for users > > that are not Python Developers. I would not think to ask > > someone to install Python on their system and make sure it > > is added to the path. Maybe it is not so hard for the non- > > technical, average 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? Are there common practices for this? > > > Your assumptions are correct! In fact, in a language that was "supposedly" designed to be an "applications language" (eat your heart out D'Aprano!!!), one would think that distributing apps would not only be obvious, but also intuitive! > > ALAS, THE CRUEL REALITIES OF INTERPRETED LANGUAGES SLAPS YOU IN THE PASTEY WHITE FACE! > > Unlike a true "applications language", like say, um, *JAVA*, one cannot simply compile an executable and distribute it in a teeny tiny binary form, no, with Python, the end user must either (1) have Python on his machine already, (2) download Python, or (3) you must package a Python interpreter along with your script (and dependencies) -- which will end up being a very large file just to run (what is in most cases) a very small script. > > BOO-HISS! > > But the good news is that, Python ships on many machines already. But of course, you're seeking more consistency in your distribution QA than the "wild guess" and the fickle nature of "lady luck". > > Many 3rd party libraries exist to solve your distribution issue. Google probably knows about all (or at least most) of them. if you did not notice Java/.NET ship with runtime VMs as well. Even C/C++ have some requirements depending on the platform. We should all switch to assembly to avoid any dependencies and port our code to each platform without hesitation.
[toc] | [prev] | [next] | [standalone]
| From | Ulli Horlacher <framstag@rus.uni-stuttgart.de> |
|---|---|
| Date | 2015-12-17 13:58 +0000 |
| Message-ID | <n4uf1l$vh$1@news2.informatik.uni-stuttgart.de> |
| In reply to | #100545 |
Rick Johnson <rantingrickjohnson@gmail.com> wrote: > Unlike a true "applications language", like say, um, *JAVA*, one cannot > simply compile an executable and distribute it in a teeny tiny binary > form, no, with Python Of course you can! If have done this with pyinstaller. This creates a standalone Windows executable you can distribute. Example: http://fex.rus.uni-stuttgart.de:8080/fexit.html -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum IZUS/TIK E-Mail: horlacher@tik.uni-stuttgart.de Universitaet Stuttgart Tel: ++49-711-68565868 Allmandring 30a Fax: ++49-711-682357 70550 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
[toc] | [prev] | [next] | [standalone]
| From | wxjmfauth@gmail.com |
|---|---|
| Date | 2015-12-17 07:21 -0800 |
| Message-ID | <68122dd7-200b-41c7-829d-dd06d7f19ac4@googlegroups.com> |
| In reply to | #100564 |
Le jeudi 17 décembre 2015 14:58:29 UTC+1, Ulli Horlacher a écrit : > Rick Johnson <rantingrickjohnson@gmail.com> wrote: > > > Unlike a true "applications language", like say, um, *JAVA*, one cannot > > simply compile an executable and distribute it in a teeny tiny binary > > form, no, with Python > > Of course you can! > If have done this with pyinstaller. This creates a standalone Windows > executable you can distribute. > Example: > http://fex.rus.uni-stuttgart.de:8080/fexit.html > > > > > -- > Ullrich Horlacher Server und Virtualisierung > Rechenzentrum IZUS/TIK E-Mail: horlacher@tik.uni-stuttgart.de > Universitaet Stuttgart Tel: ++49-711-68565868 > Allmandring 30a Fax: ++49-711-682357 > 70550 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/ I downloaded it. The good news, you are right, it works out of the box. The bad news. It crashes, when one use non ascii characters. Not a suprise, I was expected that. jmf
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2015-12-17 12:20 +1100 |
| Message-ID | <mailman.28.1450315255.30845.python-list@python.org> |
| In reply to | #100542 |
Bruce Whealton <futurewavewebdevelopment@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
[toc] | [prev] | [next] | [standalone]
| From | Michiel Overtoom <motoom@xs4all.nl> |
|---|---|
| Date | 2015-12-17 12:01 +0100 |
| Message-ID | <mailman.33.1450350162.30845.python-list@python.org> |
| In reply to | #100542 |
> On 2015-12-17, at 01:03, Bruce Whealton <futurewavewebdevelopment@gmail.com> wrote: > > 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? You might want to watch https://www.youtube.com/watch?v=wsczq6j3_bA (Brandon Rhodes: The Day of the EXE Is Upon Us - PyCon 2014). "It was once quite painful to build your Python app as a single .exe file. Support forums filled with lamentations as users struggled with primitive tools. But today, two separate tools exist for compiling your Python to real machine language! Come learn about how one of the biggest problems in commercial and enterprise software has now been solved and how you can benefit from this achievement. Slides can be found at: https://speakerdeck.com/pycon2014 and https://github.com/PyCon/2014-slides" Greetings,
[toc] | [prev] | [next] | [standalone]
| From | Oscar Benjamin <oscar.j.benjamin@gmail.com> |
|---|---|
| Date | 2015-12-17 15:30 +0000 |
| Message-ID | <mailman.37.1450366224.30845.python-list@python.org> |
| In reply to | #100542 |
On 17 December 2015 at 00:03, Bruce Whealton <futurewavewebdevelopment@gmail.com> wrote: > I watched one training video that discussed Python and Tkinter. Like many similar tutorials from online training sites, I was left scratching my head. > > What seems to be blatantly missing is how this would be distributed. 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. > > Surely, one is going to want to create GUI apps for users that are not Python Developers. I would not think to ask someone to install Python on their system and make sure it is added to the path. Maybe it is not so hard for the non-technical, average 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? > Are there common practices for this? There are different general approaches in this area. One possibility is to ship an installer. Another is to try and ship a complete single file executable. For the single-file executable you have pyinstaller/py2exe/py2app etc. If you're user can be expected to install the software before running it then in the basic case it is not too hard. Python itself comes with a graphical installer for Windows and is already installed on every other OS. If you can assume that Python is installed then you can distribute your application simply as a zip file but with a .py(z)(w) file extension. See here: https://www.python.org/dev/peps/pep-0441/ A Windows user should then be able to simply double click the .pyz file and have it run. I'm not sure how that works on a MAC but on Linux you can preface the zip file with a shebang make it executable and it will run from the terminal and from any file-browser if it knows how to run executable files. Another option for Windows although it is relatively new is that as of Python 3.5 there is an embedded distribution of Python that is intended to be shipped as part of an application installer and installed local to the application. This is new and I haven't heard anyone using it and don't know if any tools exist to help actually creating an installer using it. -- Oscar
[toc] | [prev] | [next] | [standalone]
| From | wxjmfauth@gmail.com |
|---|---|
| Date | 2015-12-17 08:28 -0800 |
| Message-ID | <af1c6253-da92-4363-945b-a5ac6a146497@googlegroups.com> |
| In reply to | #100569 |
Le jeudi 17 décembre 2015 16:30:41 UTC+1, Oscar Benjamin a écrit : > ... > Another option for Windows although it is relatively new is that as of > Python 3.5 there is an embedded distribution of Python that is > intended to be shipped as part of an application installer and > installed local to the application. This is new and I haven't heard > anyone using it and don't know if any tools exist to help actually > creating an installer using it. > D:\>cd py351embed D:\py351embed>python.exe Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> for e in sys.path: print(e) ... D:\py351embed\python35.zip D:\py351embed\DLLs D:\py351embed\lib D:\py351embed >>> >>> quit() D:\py351embed> jmf
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web