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 
<https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes#Scripting-Language-Runtimes>
   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
macy...@gmail.com

> On 5 Oct 2021, at 3:00 am, pythonmac-sig-requ...@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.jan...@cwi.nl)
> 
> From: jack.jan...@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: k...@codebykevin.com
> Cc: pythonmac-sig@python.org, macy...@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 <k...@codebykevin.com 
>> <mailto:k...@codebykevin.com>> 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 
>> <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 <http://www.codebykevin.com/>
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to