On Fri, 17 Aug 2018 at 09:38, Matthew Polack <matthew.pol...@htlc.vic.edu.au> wrote: > > We're enjoying learning Python in our school...but I have a question > regarding the way the end users should ideally run the software. > > Does this always require Python being installed as a full language on the > end users computer?
It's certainly easiest for you as the "distributor" of the code if your users already have Python installed or if it is reasonable to ask them to install it. Then you can distribute your code as a single Python .py file or as a .zip file that they should extract or even as a .pyz zip file that can be run directly with Python: https://docs.python.org/3/library/zipapp.html With the .py script or the .pyz zip file it should be possible (assuming that Python is installed in the normal way) for a user to receive the file from you and simply double-click it from the file browser. Another option is to upload your program to PyPI (the app store for Python programmers): https://pypi.org/ Then anyone who has Python installed could install the program using pip from the command line: $ pip install matts_app > ie. At the moment we install Python...add it to the path in > Windows...develop and run the software we make...workable for the > developer.....but a bit of mucking around for someone who goes to use our > programs. As you say installing (and correctly configuring) Python can be too much to ask for some users. In this case there are two broad approaches that you as a distributor of code can take. Both involve providing Python as part of what you provide to your users. The first approach is to make an installer for your program. The users who install your program will then download/receive the installer from you and run it to install the program. Your installer can then be set up to also install a private version of Python just to be used for your program. I don't know of a simple way of doing this but this is probably the approach that would be taken by well-known end-user software that happens to use Python under the hood. As an example the Dropbox software that you may use on your computer is written in Python and provides an installer that bundles Python like this. The second approach which is probably more common for someone in your situation (small development resources and a small number of non-technical end-users) is to create an .exe-like file that combines both the Python interpreter and your program together. There are many tools for doing this. Alan already mentioned py2exe, I have personally had success with pyinstaller: https://www.pyinstaller.org/ Pyinstaller can create executable files for Windows, OSX and Linux. Both the two approaches above significantly increase the size of your program as distributed to your users. You might have 3kB of code in a .py file that becomes 30MB as an .exe. > Is there some other way to get it working in either a browser... This suggests another way to provide access to your program to end users that involves minimal installation for them: make your program into a website. Then you can install Python on your server and your users just need to click a link. This obviously requires more resource on your part since you need to run (or hire) a server as well as writing a bit of code to adapt your program into a website. > ...or an Android/IOS app.... Normal Python GUI libraries don't work on these operating systems but Kivy does. You would need to switch to something like that instead of tkinter: https://kivy.org/#home Then you can package your code up as an app and put it on the app stores. Of course if you make a simple website then that would also work on smartphones as well as computers. Each of the different things above requires different amounts of work from you and from your users and places different constraints on your code. I would start by thinking about who should install your code and on what devices. The answer to that question will guide what you should do. For example, if this is for your students to show their friends/family then I would guess that smartphone apps are probably the main target, in which case look at kivy. -- Oscar _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor