Python
取得Command Line結果
參考資訊:
1. running-shell-command-and-capturing-the-output
2.x
import commands ret = commands.getoutput('ls') print ret
3.x
import subprocess ret = subprocess.run(['ls', '-l'], stdout=subprocess.PIPE).stdout.decode('utf-8') print(ret)