'{' is not recognized as internal or external command
<p>I'm new on Python and following the Google Developers tutorial. I got an error -->  <strong><em>'{' is not recognized as internal or external command</em></strong> when running 'python code.py .' with the code below. I believe my PATH variable is set correctly for python as I can run other python codes without problem. Can anybody give me some suggestions?</p>

<pre><code>import os
import sys
import commands

def List(dir):
    cmd = 'dir' + dir
    print 'about to do this:', cmd
    (status, output) = commands.getstatusoutput(cmd)
    if status:
        sys.stderr.write('there was an error:'+ output)
        sys.exit(1)
    print output

def main():
    List(sys.argv[1])

if __name__ == "__main__":
    main()
</code></pre>