How to include or install a Python runtime in an AppleScript applet

Vincentius Vincentius <[email protected]> Tue, 28 Sep 2021 15:12:00 +1000
Newsgroups gmane.comp.python.apple
Message-ID <[email protected]>
--===============6269026603876927703==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_DC7B0AC9-EC2E-496A-97DF-25CB15AB2243"


--Apple-Mail=_DC7B0AC9-EC2E-496A-97DF-25CB15AB2243
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hello,

I am not a Python developer.  So, please forgive the intrusion.

I have developed an AppleScript applet which provides a GUI =
=E2=80=9Cfrontend=E2=80=9D for a Python script provided by another =
developer.  The applet runs on any version of macOS from OSX 10.10 up.

The Python script is very functional but only works from Terminal and =
invoking it correctly it is complex especially for users not familiar =
with Terminal.  My applet simplifies all that so Mac users can more =
easily access the functionality of the Python script.

As you will guess, the applet currently works because Apple for many =
years have included Python2.7 in macOS.  But, recently, development of =
the Python script has ceased and I have to move to another Python script =
(forked from the original) which is actively developed.

My problem is that the new Python script requires Python3 which is not =
in macOS.  So, I need to find a way of providing a Python runtime to =
users of my applet.

Can anyone help me with advice on how to create and distribute a Python =
runtime (with my applet) ?

The shebang in the script has this:  #! usr/bin/env Python3.  I guess =
that means the script will call the Python3 stub located in /usr/bin/.  =
But, that will invoke the Xcode Command Line tools download which most =
of my users will not want.  How do I redirect that call to a Python3 =
runtime ?=20

As the wider Mac developer and user community learn that they need =
Python3, there will be a growing need for simple Python3 runtimes.  But, =
the macOS distribution currently available includes the IDE and other =
development tools which, again, most of my users will not want.  Would =
it possible to prepare a runtime installer suitable for users who wish =
to run Python apps and scripts ?

Thanks.


Garry
[email protected]=

--Apple-Mail=_DC7B0AC9-EC2E-496A-97DF-25CB15AB2243
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" =
class=3D"">Hello,<div class=3D""><br class=3D""></div><div class=3D"">I =
am not a Python developer. &nbsp;So, please forgive the =
intrusion.</div><div class=3D""><br class=3D""></div><div class=3D"">I =
have developed an AppleScript applet&nbsp;<font color=3D"#000000" =
face=3D"TimesNewRomanPSMT" class=3D""><span style=3D"caret-color: rgb(0, =
0, 0);" class=3D"">which provides a GUI =E2=80=9Cfrontend=E2=80=9D for a =
Python script provided by&nbsp;another developer. &nbsp;The applet runs =
on any version of macOS from OSX 10.10 up.</span></font></div><div =
class=3D""><font color=3D"#000000" face=3D"TimesNewRomanPSMT" =
class=3D""><span style=3D"caret-color: rgb(0, 0, 0);" class=3D""><br =
class=3D""></span></font></div><div class=3D""><font color=3D"#000000" =
face=3D"TimesNewRomanPSMT" class=3D"">The Python script is very =
functional but only works from Terminal and invoking it correctly it is =
complex especially for users not familiar with Terminal. &nbsp;My applet =
simplifies all that so&nbsp;Mac users can more easily access the =
functionality of the Python script.</font></div><div class=3D""><div =
class=3D"" style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); =
font-family: TimesNewRomanPSMT;"><br class=3D""></div><div class=3D"" =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: =
TimesNewRomanPSMT;">As you will guess, the applet currently works =
because Apple for many years have included Python2.7 in macOS. =
&nbsp;But, recently, development of the Python script has ceased and I =
have to move to another Python script (forked from the original) which =
is actively developed.</div><div class=3D"" style=3D"caret-color: rgb(0, =
0, 0); color: rgb(0, 0, 0); font-family: TimesNewRomanPSMT;"><br =
class=3D""></div><div class=3D"" style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0); font-family: TimesNewRomanPSMT;">My problem is that =
the new Python script requires Python3 which is not in macOS. &nbsp;So, =
I need to find a way of providing a Python&nbsp;<span =
class=3D"">runtime</span>&nbsp;to users of my applet.</div><div class=3D""=
 style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: =
TimesNewRomanPSMT;"><br class=3D""></div><div class=3D"" =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: =
TimesNewRomanPSMT;">Can anyone help me with advice on how to create and =
distribute a Python runtime (with my applet) ?</div></div><div class=3D"" =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: =
TimesNewRomanPSMT;"><br class=3D""></div><div class=3D"" =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: =
TimesNewRomanPSMT;">The shebang in the script has this: &nbsp;#! =
usr/bin/env Python3. &nbsp;I guess that means the script will call the =
Python3 stub located in /usr/bin/. &nbsp;But, that will invoke the Xcode =
Command Line tools download which most of my users will not want. =
&nbsp;How do I redirect that call to a Python3 runtime ?&nbsp;</div><div =
class=3D""><br class=3D""></div><div class=3D"">As the wider Mac =
developer and user community learn that they need Python3, there will be =
a growing need for simple Python3 runtimes. &nbsp;But, the macOS =
distribution currently available includes the IDE and other development =
tools which, again, most of my users will not want. &nbsp;Would it =
possible to prepare a runtime installer suitable for users who wish to =
run Python apps and scripts ?</div><div class=3D""><br =
class=3D""></div><div class=3D"">Thanks.</div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""><div class=3D"">
<div style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); =
font-family: &quot;Times New Roman&quot;; font-size: 16px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
text-decoration: none;">Garry</div><div style=3D"caret-color: rgb(0, 0, =
0); color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; =
font-size: 16px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a></div></div></div></body></html>=

--Apple-Mail=_DC7B0AC9-EC2E-496A-97DF-25CB15AB2243--

--===============6269026603876927703==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG

--===============6269026603876927703==--