Python as script files

Posted on
Fri Oct 04, 2019 9:00 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Python as script files

A couple questions re running Python as files.
1) does a file created in BBEdit need to be compiled, or is it sufficient to merely save the text file with the 'py' extension?
2) does a python script file need the tell/end tell 'wrapper' similar to that required by Apple Scripts?
Anything else? If I copy an embedded script and save it with the py extension, will it run?

Posted on
Fri Oct 04, 2019 11:13 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Python as script files

1) does a file created in BBEdit need to be compiled, or is it sufficient to merely save the text file with the 'py' extension?
==> no compile (there is a "recompile in python that creates .pyc or .pyo files, but not needed)
==> just save as .py

2) does a python script file need the tell/end tell 'wrapper' similar to that required by Apple Scripts?
==> no,
==> if execution does not take too long(< 10 sec real time) just put the script into server/actions/executescript

Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests