3 ms·
The commands module is now deprecated by the overly complicated subprocess module, but content = commands.getoutput(x) is much better than os.sys
by robrenaud 14y ago
The commands module is now deprecated by the overly complicated subprocess module, but
content = commands.getoutput(x)
is much better than
os.system(x + ' > foo')
content = open('foo', 'r').read()
- icebraining 14y agoThe subprocess mode is really not that complicated. Your example can be written as: content = subprocess.check_output(x, shell=True)