2
我很努力地用子進程替換commands.getoutput。 請參見下面的代碼:用子進程替換commands.getoutput
import subprocess
import commands
dir = subprocess.check_output(['pwd'])
print dir+"/*.py"
dir = commands.getoutput('pwd')
print dir+"/*.py"
這裏的輸出中:
/home/akik/py
/*.py
/home/akik/py/*.py
請幫我修復它。
謝謝你。我已經使用replace()函數解決了它。 – user2420437