summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2016-03-12 10:56:45 +0100
committerIlya Etingof <etingof@gmail.com>2016-03-12 10:56:45 +0100
commitc45f60f04988f3d8810a275f7c83fb7620c3f8e3 (patch)
tree4b11d0aef3f1b087ccd1f85fa585e7db5bb8ed7b /README.md
parentd524518183dd023915324f0ed2b666a61bc0d39f (diff)
downloadpysnmp-git-c45f60f04988f3d8810a275f7c83fb7620c3f8e3.tar.gz
pypy does not work yet
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 8 insertions, 11 deletions
diff --git a/README.md b/README.md
index 1911fb2b..38ab63df 100644
--- a/README.md
+++ b/README.md
@@ -77,25 +77,22 @@ high-level and easy to use API is called *hlapi* and can be used like this:
```python
from pysnmp.hlapi import *
-iterator = getCmd(
- SnmpEngine(),
- CommunityData('public'),
- UdpTransportTarget(('demo.snmplabs.com', 161)),
- ContextData(),
- ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0))
-)
+iterator = getCmd(SnmpEngine(),
+ CommunityData('public'),
+ UdpTransportTarget(('demo.snmplabs.com', 161)),
+ ContextData(),
+ ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0)))
errorIndication, errorStatus, errorIndex, varBinds = next(iterator)
if errorIndication: # SNMP engine errors
- print errorIndication
+ print(errorIndication)
else:
if errorStatus: # SNMP agent errors
- print(%s at %s' % (errorStatus.prettyPrint(),
- errorIndex and varBinds[int(errorIndex)-1] or '?'))
+ print(%s at %s' % (errorStatus.prettyPrint(), varBinds[int(errorIndex)-1] if errorIndex else '?'))
else:
for varBind in varBinds: # SNMP response contents
- print('='.join([x.prettyPrint() for x in varBind]))
+ print(' = '.join([x.prettyPrint() for x in varBind]))
```
We maintain publically available SNMP Agent and TRAP sink at