将Paramiko stdout的ping结果写入txt文件

时间:2015-12-28 22:59:40

标签: python-2.7 stdout ping paramiko

我有一种方法可以连接到主机并ping它。我可以在屏幕上看到ping结果,但无法将它们写入文件。该文件始终为空。在这方面有谁能帮助我?

es_staging (enable all completed harmony features)
        type: bool  default: false
  --harmony (enable all completed harmony features)
        type: bool  default: false
  --harmony_shipping (enable all shipped harmony fetaures)
        type: bool  default: true
  --legacy_const (legacy semantics for const in sloppy mode)
        type: bool  default: true
  --harmony_modules (enable "harmony modules" (in progress))
        type: bool  default: false
  --harmony_regexps (enable "harmony regular expression extensions" (in progress))
        type: bool  default: false
  --harmony_proxies (enable "harmony proxies" (in progress))
        type: bool  default: false
  --harmony_sloppy_function (enable "harmony sloppy function block scoping" (in progress))
        type: bool  default: false
  --harmony_sloppy_let (enable "harmony let in sloppy mode" (in progress))
        type: bool  default: false
  --harmony_unicode_regexps (enable "harmony unicode regexps" (in progress))
        type: bool  default: false
  --harmony_reflect (enable "harmony Reflect API" (in progress))
        type: bool  default: false
  --harmony_destructuring (enable "harmony destructuring" (in progress))
        type: bool  default: false
  --harmony_default_parameters (enable "harmony default parameters" (in progress))
        type: bool  default: false
  --harmony_sharedarraybuffer (enable "harmony sharedarraybuffer" (in progress))
        type: bool  default: false
  --harmony_atomics (enable "harmony atomics" (in progress))
        type: bool  default: false
  --harmony_simd (enable "harmony simd" (in progress))
        type: bool  default: false
  --harmony_array_includes (enable "harmony Array.prototype.includes")
        type: bool  default: false
  --harmony_tostring (enable "harmony toString")
        type: bool  default: false
  --harmony_concat_spreadable (enable "harmony isConcatSpreadable")
        type: bool  default: false
  --harmony_rest_parameters (enable "harmony rest parameters")
        type: bool  default: false
  --harmony_sloppy (enable "harmony features in sloppy mode")
        type: bool  default: false
  --harmony_arrow_functions (enable "harmony arrow functions")
        type: bool  default: true
  --harmony_new_target (enable "harmony new.target")
        type: bool  default: true
  --harmony_object_observe (enable "harmony Object.observe")
        type: bool  default: true
  --harmony_spreadcalls (enable "harmony spread-calls")
        type: bool  default: true
  --harmony_spread_arrays (enable "harmony spread in array literals")
        type: bool  default: true
  --harmony_object (enable "harmony Object methods")
        type: bool  default: true

我还尝试将stdout存储到变量中,然后将该变量写入文件中,但没有得到任何结果。我还在网站上找到了一些关于Paramiko输出的主题,但没有一个能帮助过。

0 个答案:

没有答案