title: Parsing Print output from 4 data source
body: <p>EDIT:
  Sorry for the delay....  This is still giving me issues -</p>
  
  <pre><code>Traceback (most recent call last):
    File "snmp1.py", line 18, in &lt;module&gt;
      print_snmp_event(varBindTableRow)
    File "snmp1.py", line 7, in print_snmp_event
      print '{1} = {3}'.format(*data)
  IndexError: tuple index out of range
  </code></pre>
  
  <p>That is the output I get when I try and run your latest suggestion.</p>
  
  <hr>
  
  <p>I am having issues printing this correctly  I am running SNMP on a router and I am getting the following as an output on print.  I am using pysnmp to send this data to the router.</p>
  
  <pre><code>from pysnmp.entity.rfc3413.oneliner import cmdgen
  
  cmdGen = cmdgen.CommandGenerator()
  varBindTable = cmdGen.nextCmd(
          cmdgen.CommunityData('STRING'),
          cmdgen.UdpTransportTarget(('router', 161)),
          '1.3.6.1.2.1.2.2.1.2','1.3.6.1.2.1.2.2.1.14'
  )
  
  
  for varBindTableRow in varBindTable:
      print varBindTableRow
  </code></pre>
  
  <p>My output is</p>
  
  <pre><code>[(ObjectName(1.3.6.1.2.1.2.2.1.2.222), OctetString('Gi4/2')), (ObjectName(1.3.6.1.2.1.2.2.1.15.215), Counter32(0))] 
  </code></pre>
  
  <p>What I want to get is</p>
  
  <pre><code>Gi4/2 = 0
  </code></pre>
  
  <p>I would think i could printout 1,3 but its not working.  Anyone have any tips?</p>
  
  <p>Sorry here is the output:</p>
  
  <pre><code>print type(varBindTableRow[0])
  TypeError: 'NoneType' object has no attribute '__getitem__'
  print type(varBindTableRow[0][0])
  TypeError: 'NoneType' object has no attribute '__getitem__'
  print repr(varBindTableRow)
  [[(ObjectName(1.3.6.1.2.1.2.2.1.2.1), OctetString('FastEthernet0/0')), (ObjectName(1.3.6.1.2.1.2.2.1.14.1), Counter32(0))],
  print repr(varBindTableRow[0])
  TypeError: 'NoneType' object has no attribute '__getitem__'
  print repr(varBindTableRow[0][0])
  TypeError: 'NoneType' object has no attribute '__getitem__'
  </code></pre>
  
  <p>When I run the script you gave, I get the following:</p>
  
  <pre><code>Traceback (most recent call last):
    File "snmp_pull.py", line 18, in &lt;module&gt;
      print_snmp_event(varBindTableRow)
    File "snmp_pull.py", line 7, in print_snmp_event
      print '{1} = {3}'.format(*data)
  IndexError: tuple index out of range
  </code></pre>
  
  <p>Thanks again for all the help!</p>