Replacing commands.getoutput with subprocess
I am struggling to replace commands.getoutput with subprocess. Please see
the codes below:
import subprocess
import commands
dir = subprocess.check_output(['pwd'])
print dir+"/*.py"
dir = commands.getoutput('pwd')
print dir+"/*.py"
Here's the ouput:
/home/akik/py
/*.py
/home/akik/py/*.py
Please help me fixing it.
No comments:
Post a Comment