Sean Sean - 7 months ago 59
Bash Question

How to execute Python inline from a bash shell

Is there a Python argument to execute code from the shell without starting up an interactive interpreter or reading from a file?
Something similar to:

perl -e 'print "Hi"'

Answer

This works:

python -c 'print "Hi"'
Hi