1

In a shell, I can execute AppleScript command-line code like so:

osascript -e "tell application \"Finder\" to activate"

Is the same thing possible in Python, e.g.:

python --execute "print('hello world!')"
2
  • 1
    man python will point you in the right direction. Commented Nov 18, 2020 at 12:44
  • 3
    Does this answer your question? How to execute Python inline from a bash shell Commented Nov 18, 2020 at 12:46

1 Answer 1

3

Something like this should work for you!

python -c 'print("Hi")'

Probably a duplicate of How to execute Python inline from a bash shell

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.