我正在尝试dict()
使用 Pythons Rich 打印。据我了解,这应该在不同的行等上输出数据。有点像pprint
.
但我得到:
>>> from rich import print
>>> print(output)
{'GigabitEthernet0/1': {'description': '## Connected to leaf-2 ##', 'type': 'iGbE', 'oper_status': 'up',
'phys_address': '5000.0009.0001', 'port_speed': 'auto speed', 'mtu': 1500, 'enabled': True, 'bandwidth': 1000000,
'flow_control': {'receive': False, 'send': False}, 'mac_address': '5000.0009.0001', 'auto_negotiate': True,
'port_channel': {'port_channel_member': False}, 'duplex_mode': 'auto', 'delay': 10, 'accounting': {'other': {'pkts_in':
0, 'chars_in': 0, 'pkts_out': 431258, 'chars_out': 25875480}, 'ip': {'pkts_in': 513383, 'chars_in': 42910746,
'pkts_out': 471188, 'chars_out': 45342027}, 'dec mop': {'pkts_in': 0, 'chars_in': 0, 'pkts_out': 7163, 'chars_out':
551551}, 'arp': {'pkts_in': 3845, 'chars_in': 230700, 'pkts_out': 3846, 'chars_out': 230760}, 'cdp': {'pkts_in': 72010,
'chars_in': 18866620, 'pkts_out': 79879, 'chars_out': 31221768}}, 'ipv4': {'10.1.1.5/30': {'ip': '10.1.1.5', ...
有什么建议么?