title: python -c and `while`
body: <p>Is there a way to loop in <code>while</code> if you start the script with <code>python -c</code>?  This doesn't seem to be related to platform or python version...</p>
  
  <p><strong>Linux</strong></p>
  
  <pre><code>[mpenning@Hotcoffee ~]$ python -c "import os;while (True):    os.system('ls')"
    File "&lt;string&gt;", line 1
      import os;while (True):    os.system('ls')
                    ^
  SyntaxError: invalid syntax
  [mpenning@Hotcoffee ~]$
  [mpenning@Hotcoffee ~]$ python -V
  Python 2.6.6
  [mpenning@Hotcoffee ~]$ uname -a
  Linux Hotcoffee 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux
  [mpenning@Hotcoffee ~]$
  </code></pre>
  
  <p><strong>Windows</strong></p>
  
  <pre><code>C:\Users\mike_pennington&gt;python -c "import os;while True: os.system('dir')"
    File "&lt;string&gt;", line 1
      import os;while True: os.system('dir')
                    ^
  SyntaxError: invalid syntax
  
  C:\Users\mike_pennington&gt;python -V
  Python 2.7.2
  
  C:\Users\mike_pennington&gt;
  </code></pre>
  
  <p>I have tried removing parenthesis in the <code>while</code> statement, but nothing seems to make this run.</p>