ファブリックv1.4.3は「python--version」の出力をキャプチャしません
def python_v():
m = local('python --version', capture=True)
print(m)
ファブリックv1.4.3は「python--version」の出力をキャプチャしません
def python_v():
m = local('python --version', capture=True)
print(m)
localwithcapture=Trueはコマンドのstdout;を返します。簡単なテストはpython --version、にバージョン情報を出力することを示していstderrます。したがって、次のコマンドでリダイレクトstderrを試みることができます。stdout
m = local('python --version 2>&1', capture=True)
私は次の方法が受け入れられた答えよりもきれいだと思います:
print m.stderr
(ありがとうレモス!)