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
Another way is to you use bash redirection:
python <<< 'print "Hi"'
And this works also with perl, ruby, and what not.
p.s.
To save quote ' and " for python code, we can build the block with EOF
c=`cat <