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