python -c \'import sys; print \"a\"\'
works, and
python -c \'for a in [1, 2, 3]: print a\'
works, but
<
Not an answer to your exact question, but still may help someone. You can actually split the command line in shell.
sh/bash/etc:
python -c 'import sys
for a in [1, 2, 3]: print a'
Windows cmd (C:\> and 'More?' are cmd prompts, don't enter those):
C:\>python -c import sys^
More?
More? for a in [1, 2, 3]: print a