Execute a Python statement in a Bash script
Question: Is it possible to have Python evaluate a Python statement within a Bash shell
script? I am thinking about something along the lines of perl's `-e` option.

The problem at hand is that I'd like to use Python's `split` function on a
Bash string. I know it's doable in Bash alone, but I am curious.


Answer: The equivalent of `perl -e` is `python -c`:

    
    
    $ python -c "import sys;print sys.argv[1].split(',')" "foo,bar,baz"
    ['foo', 'bar', 'baz']
    

