Fabric v1.4.3 does not capture the output of 'python --version'
def python_v():
m = local('python --version', capture=True)
print(m)
local
with capture=True
returns the command's stdout
; a simple test shows that python --version
prints the version info on stderr
. So, you can try to redirect stderr
to stdout
in the command:
m = local('python --version 2>&1', capture=True)
I find the following way cleaner than the accepted answer:
print m.stderr
(Thanks remosu!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With