From kw at codebykevin.com Sat Oct 2 10:22:09 2021 From: kw at codebykevin.com (Kevin Walzer) Date: Sat, 2 Oct 2021 10:22:09 -0400 Subject: [Pythonmac-SIG] How to include or install a Python runtime in an AppleScript applet In-Reply-To: <189E9197-1769-47CD-9364-3F0E409CFC3C@gmail.com> References: <189E9197-1769-47CD-9364-3F0E409CFC3C@gmail.com> Message-ID: <3da5bae4-ab5a-7cff-bf83-0db181c8b359@codebykevin.com> On 9/28/21 1:12 AM, Vincentius Vincentius wrote: > > Can anyone help me with advice on how to create and distribute a > Python runtime (with my applet) ? > Point your users to the installer for the Mac version of Python: https://www.python.org/ftp/python/3.9.7/python-3.9.7-macosx10.9.pkg There is no simple way to embed a Python installation within an AppleScript applet. If you're doing that, you might as well all the way and deploy your script as a full Mac application with Python libraries bundled using a tool like py2app. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From macytdl at gmail.com Sat Oct 2 22:34:28 2021 From: macytdl at gmail.com (Vincentius Vincentius) Date: Sun, 3 Oct 2021 13:34:28 +1100 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 189, Issue 1 In-Reply-To: References: Message-ID: <899538BB-42A1-49B6-A368-2415E7306CE3@gmail.com> Kevin, many thanks. Requiring users to install Python themselves might be asking too much for many ? they would just look somewhere else for a tool that doesn?t impose requirements. Anyway the standard install comes with developer tools that the ordinary user will not need and, from my experience, object to. I?ve been pointed to PyInstaller which might be a solution for distributing the Python script separately. Cheers. Garry macytdl at gmail.com > On 3 Oct 2021, at 3:00 am, pythonmac-sig-request at python.org wrote: > >> Can anyone help me with advice on how to create and distribute a Python runtime (with my applet) ? >> > Point your users to the installer for the Mac version of Python: > > https://www.python.org/ftp/python/3.9.7/python-3.9.7-macosx10.9.pkg > There is no simple way to embed a Python installation within an AppleScript applet. If you're doing that, you might as well all the way and deploy your script as a full Mac application with Python libraries bundled using a tool like py2app. > > --Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jack.jansen at cwi.nl Sun Oct 3 19:04:10 2021 From: jack.jansen at cwi.nl (jack.jansen at cwi.nl) Date: Mon, 4 Oct 2021 01:04:10 +0200 Subject: [Pythonmac-SIG] How to include or install a Python runtime in an AppleScript applet In-Reply-To: <3da5bae4-ab5a-7cff-bf83-0db181c8b359@codebykevin.com> References: <189E9197-1769-47CD-9364-3F0E409CFC3C@gmail.com> <3da5bae4-ab5a-7cff-bf83-0db181c8b359@codebykevin.com> Message-ID: <89A519F0-6CDF-48CE-BD13-BB521D5B3CA0@cwi.nl> Another option would be that the AppleScript checks whether the correct Python is installed (or maybe one of several usable Pythons, for example the official Python 3.x installer or a brew installation) and use that if it is. And if no suitable Python is found it could redirect the user to a web page with instructions on how to install a compatible Python. That is sort-of what Kevin suggests (Point users to a Python installation), but with a bit of automation added. Jack > On 2 Oct 2021, at 16:22, Kevin Walzer wrote: > > > On 9/28/21 1:12 AM, Vincentius Vincentius wrote: >> >> Can anyone help me with advice on how to create and distribute a Python runtime (with my applet) ? >> > Point your users to the installer for the Mac version of Python: > > https://www.python.org/ftp/python/3.9.7/python-3.9.7-macosx10.9.pkg > There is no simple way to embed a Python installation within an AppleScript applet. If you're doing that, you might as well all the way and deploy your script as a full Mac application with Python libraries bundled using a tool like py2app. > > --Kevin > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From macytdl at gmail.com Mon Oct 4 19:42:26 2021 From: macytdl at gmail.com (Vincentius Vincentius) Date: Tue, 5 Oct 2021 10:42:26 +1100 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 189, Issue 3 In-Reply-To: References: Message-ID: <3C7C644F-40E8-4647-92DA-672DD1C59C08@gmail.com> Thanks, yes, that is an option I?ve considered. My applet already checks for required components and handles the download and install for the user (who only needs to provide admin credentials). But, Apple?s recommendation is for developers to include a Python runtime with the app I guess that's because apps can be finicky over which version of Python they require with as well as the range of modules required. So, I?ve been working with the developer of the Python tool my applet uses to use PyInstaller to build a single file executable containing the script, Python and required modules. That can be built by a GitHub YAML script and published for all Mac users. It?ll probably be built to run on macOS 10.15 Catalina and Universal2 architecture. My AS applet will then be able to download, install and use the executable in the same way as its existing components. Cheers. Garry macytdl at gmail.com > On 5 Oct 2021, at 3:00 am, pythonmac-sig-request at python.org wrote: > > Send Pythonmac-SIG mailing list submissions to > > 1. Re: How to include or install a Python runtime in an > AppleScript applet (jack.jansen at cwi.nl) > > From: jack.jansen at cwi.nl > Subject: Re: [Pythonmac-SIG] How to include or install a Python runtime in an AppleScript applet > Date: 4 October 2021 at 10:04:10 am AEDT > To: kw at codebykevin.com > Cc: pythonmac-sig at python.org, macytdl at gmail.com > > > Another option would be that the AppleScript checks whether the correct Python is installed (or maybe one of several usable Pythons, for example the official Python 3.x installer or a brew installation) and use that if it is. And if no suitable Python is found it could redirect the user to a web page with instructions on how to install a compatible Python. > > That is sort-of what Kevin suggests (Point users to a Python installation), but with a bit of automation added. > > Jack > > >> On 2 Oct 2021, at 16:22, Kevin Walzer > wrote: >> >> >> On 9/28/21 1:12 AM, Vincentius Vincentius wrote: >>> >>> Can anyone help me with advice on how to create and distribute a Python runtime (with my applet) ? >>> >> Point your users to the installer for the Mac version of Python: >> >> https://www.python.org/ftp/python/3.9.7/python-3.9.7-macosx10.9.pkg >> There is no simple way to embed a Python installation within an AppleScript applet. If you're doing that, you might as well all the way and deploy your script as a full Mac application with Python libraries bundled using a tool like py2app. >> >> --Kevin >> >> -- >> Kevin Walzer >> Code by Kevin >> http://www.codebykevin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: