Is there a Mac equivalent to the Windows Batch code below? Really the first line is what I care about. I just purchased a Mac and have really grown used to running Python scripts from within .bat files for ease of use.
@echo off & python -x "%~f0" %* & goto :PrintInBatch
print(‘This was printed from Python’)
echo = """
:PrintInBatch
echo This was printed from Batch """
A simpler example would just be something like this:
@echo off & python -x "%~f0" %* % goto :eof
print('This was printed from Python')
With this setup, you can just double click the .bat file and it runs the Python code inside. Can this be done with MacOS?