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
Added in 2021:
For some reason the cmd version above does not work on my current Windows 10 environment. Seems like w/o quotes Python interpreter truncates the command at first space. This variant still works:
C:\>python -c ^
More? "import sys^
More?
More? for a in [1, 2, 3]: print a
Please note, that you need to press ENTER immediately after the caret (^) symbol. Also please note the double quote on the first continuation line in the last example.
-cflag; the same thing happens in the REPL.SyntaxError: invalid syntaxpython -c 'import sys; [print(i) for i in [1, 2, 3]]