title: How can I run inline Python code in a command-line shell?
body: <p>In a shell, I can execute AppleScript command-line code like so:</p>
  <pre><code>osascript -e &quot;tell application \&quot;Finder\&quot; to activate&quot;
  </code></pre>
  <p>Is the same thing possible in Python, e.g.:</p>
  <pre><code>python --execute &quot;print('hello world!')&quot;
  </code></pre>