我如何对齐打印此输出

时间:2019-09-25 10:35:13

标签: python

我需要按照与终端显示相同的方式打印此输出: 图片:https://ufile.io/t3g26vk0

import sys
import paramiko
from pip._internal.utils import logging


def poper():

    p = paramiko.SSHClient()
    p.set_missing_host_key_policy(
        paramiko.AutoAddPolicy())  # This script doesn't work for me unless this line is added!
    p.connect("172.17.85.250", port=22, username="stack", password="salman")
    stdin, stdout, stderr = p.exec_command("openstack server list")
    opt = stdout.readlines()
    opt = "".join(opt)
    return opt

0 个答案:

没有答案