Re: [Tutor] Recommended way for end users to run our Python programs?
On Fri, 17 Aug 2018 at 09:38, Matthew Polack 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
Re: [Tutor] Recommended way for end users to run our Python programs?
https://play.google.com/store/apps/details?id=ru.iiec.pydroid3 that one also supports kivy, tkinter on android last time i checked py android support i agree is more than lacking Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius On Sun, 19 Aug 2018, 17:01 Alan Gauld, wrote: > On 19/08/18 12:11, Abdur-Rahmaan Janhangeer wrote: > > btw qpython supports sl4a since long > > > > maybe you meant : "no packaged options" > > Never heard of sl4a, ... OK I did a search. > Its a scripting interface to the Android API that > supports Python. > > It looks interesting, next time I have a spare week > I'll need to investigate in more detail. Thanks for the > pointer. > > What I meant was that the OPs Tkinter program wouldn't > work on Android (or any of the other "standard" Python > GUI toolkits). > > -- > > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.amazon.com/author/alan_gauld > Follow my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Recommended way for end users to run our Python programs?
On 19/08/18 12:11, Abdur-Rahmaan Janhangeer wrote: > btw qpython supports sl4a since long > > maybe you meant : "no packaged options" Never heard of sl4a, ... OK I did a search. Its a scripting interface to the Android API that supports Python. It looks interesting, next time I have a spare week I'll need to investigate in more detail. Thanks for the pointer. What I meant was that the OPs Tkinter program wouldn't work on Android (or any of the other "standard" Python GUI toolkits). -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Recommended way for end users to run our Python programs?
btw qpython supports sl4a since long maybe you meant : "no packaged options" Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius On Fri, 17 Aug 2018, 12:50 Alan Gauld via Tutor, wrote: > On 17/08/18 05:40, Matthew Polack wrote: > > > Does this always require Python being installed as a full language on the > > end users computer? > > No. It does require the Python interpreter plus any modules > you write or use(including any modules your modules use...) > > There are a few tools around that can collect this information > and build an executable "exe" file that bundles everything > together for convenience. py2exe being the best known. > > The downside of this is that if you install several such > programs you wind up installing multiple copies of Python > which is a bit of a waste of space - but disk space is > cheap nowadays... > > > Is there some other way to get it working in either a browser...or as a > > 'self contained' windows app ...or an Android/IOS appor a regular > > Windows .exe file to install? > > For Android there is a toolset called Kivvy that some have used > successfully. Personally I use the QPython IDE on Android but > it only supports CLI programs, no GUI. (I think it can run > Kivvy code too) > > I have no idea about Python on iOS... > > On the other hand requiring Python on the target platform is > not such an unusual thing. For many years VisualBasic programs > required a VBRUN.DLL to be installed. And Java programs require > the JVM to be in place. So you can just build a Windows > installer that checks if Python is already there and if > not installs Python and then adds your code. > > HTH > > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.amazon.com/author/alan_gauld > Follow my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Recommended way for end users to run our Python programs?
On 17/08/18 05:40, Matthew Polack wrote: > Does this always require Python being installed as a full language on the > end users computer? No. It does require the Python interpreter plus any modules you write or use(including any modules your modules use...) There are a few tools around that can collect this information and build an executable "exe" file that bundles everything together for convenience. py2exe being the best known. The downside of this is that if you install several such programs you wind up installing multiple copies of Python which is a bit of a waste of space - but disk space is cheap nowadays... > Is there some other way to get it working in either a browser...or as a > 'self contained' windows app ...or an Android/IOS appor a regular > Windows .exe file to install? For Android there is a toolset called Kivvy that some have used successfully. Personally I use the QPython IDE on Android but it only supports CLI programs, no GUI. (I think it can run Kivvy code too) I have no idea about Python on iOS... On the other hand requiring Python on the target platform is not such an unusual thing. For many years VisualBasic programs required a VBRUN.DLL to be installed. And Java programs require the JVM to be in place. So you can just build a Windows installer that checks if Python is already there and if not installs Python and then adds your code. HTH -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor