Amaury Forgeot d'Arc added the comment:
The documentation http://docs.python.org/library/commands.html
prominently says "Platforms: Unix". This module does not work on Windows.
You should really use the subprocess module:
>>> import subprocess
>>> output = subprocess.check_output("dir", shell=T
New submission from Pavel Fedin :
commands.getoutput() is broken on Windows. The issue has been detected in
v2.7.2, but still persists in v2.7.3:
--- cut ---
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on
win32
Type "help", "copyright", "credits" or "license" for m