Python easysnmp模块返回以下列表:
4
据我了解,该列表包含两个元素:
[<SNMPVariable value='__default_arp_policer__' (oid='jnxFWCounterDisplayName', oid_index='23.95.95.100.101.102.97.117.108.116.95.97.114.112.95.112.111.108.105.99.101.114.95.95.23.95.95.100.101.102.97.117.108.116.95.97.114.112.95.112.111.108.105.99.101.114.95.95.3', snmp_type='OCTETSTR')>, <SNMPVariable value='bw-15Mbps-ge-0/0/1.50-inet-i' (oid='jnxFWCounterDisplayName', oid_index='28.98.119.45.49.53.77.98.112.115.45.103.101.45.48.47.48.47.49.46.53.48.45.105.110.101.116.45.105.28.98.119.45.49.53.77.98.112.115.45.103.101.45.48.47.48.47.49.46.53.48.45.105.110.101.116.45.105.3', snmp_type='OCTETSTR')>]
.. and:
<SNMPVariable value='__default_arp_policer__' (oid='jnxFWCounterDisplayName', oid_index='23.95.95.100.101.102.97.117.108.116.95.97.114.112.95.112.111.108.105.99.101.114.95.95.23.95.95.100.101.102.97.117.108.116.95.97.114.112.95.112.111.108.105.99.101.114.95.95.3', snmp_type='OCTETSTR')>
这两个列表项是哪种数据类型?括号不是用来在Python中定义不可变列表吗?另外,我尝试在Python交互式shell中定义类似的内容,但收到语法错误:
<SNMPVariable value='bw-15Mbps-ge-0/0/1.50-inet-i' (oid='jnxFWCounterDisplayName', oid_index='28.98.119.45.49.53.77.98.112.115.45.103.101.45.48.47.48.47.49.46.53.48.45.105.110.101.116.45.105.28.98.119.45.49.53.77.98.112.115.45.103.101.45.48.47.48.47.49.46.53.48.45.105.110.101.116.45.105.3', snmp_type='OCTETSTR')>