title: When reading from dictionary I get 'int' object has no attribute '__getitem__' error
body: <p>In one python file I store values in a dictionary
  eg:</p>
  
  <pre><code> messageDict[ObservationRawDataId] = {'timestamp': TimeStamp, 'tanksystemid': TankSystemId,
                          'newDelivery': delivery,'oldDelivery':RawDeliveryLitres ,'grade' :ProductName,'sitecode':SiteCode}
   formMessageBody(messageDict)
  </code></pre>
  
  <p>In another python file I try to formulate a plain text messge from that dictionary;</p>
  
  <pre><code>def formMessageBody( messageDict) :
      try :
          print 'SiteCode', 'Date', 'Product', 'NewDelievry','OldDelivery'
          for tuple_a in messageDict.items():
              for dic_a in tuple_a:
                  print tuple_a
                  print dic_a['sitecode']
                  print  dic_a['sitecode'], dic_a['timestamp'], dic_a['grade'],
                                                              dic_a['newDelivery'],dic_a['oldDelivery']
      except Exception as error:
          print format(error)
  </code></pre>
  
  <p>but I could not read value from the tuple.
  tuple_a prints as;</p>
  
  <pre><code>(14118912, {'newDelivery': '8397.000', 'grade': u'Unleaded', 'timestamp': datetime.datetime(2019, 6, 23, 0, 0), 'tanksystemid': 5977, 'oldDelivery': 8397.0, 'sitecode': u'1156'})
  </code></pre>
  
  <p>When I try to retrieve;
  dic_a['sitecode']
  dic_a['timestamp']
  I get;</p>
  
  <pre><code>'int' object has no attribute '__getitem__'
  </code></pre>
  
  <p>error.
  What Im doing wrong here?</p>
  
  <p>messageDict looks liek;</p>
  
  <pre><code>{14090233: {'newDelivery': '5009.000', 'grade': u'E10', 'timestamp': datetime.datetime(2019, 6, 21, 0, 0), 'tanksystemid': 5776, 'oldDelivery': 5009.0, 'sitecode': u'4169'}, 14129146: {'newDelivery': '17091.000', 'grade': u'Unleaded', 'timestamp': datetime.datetime(2019, 6, 24, 0, 0), 'tanksystemid': 8720, 'oldDelivery': 17091.0, 'sitecode': u'2328'}, 14118907: {'newDelivery': '13797.000', 'grade': u'Unleaded', 'timestamp': datetime.datetime(2019, 6, 23, 0, 0), 'tanksystemid': 5973, 'oldDelivery': 13797.0, 'sitecode': u'1151'}, 14145533: {'newDelivery': '8281.000', 'grade': u'PULP', 'timestamp': datetime.datetime(2019, 6, 24, 0, 0), 'tanksystemid': 5360, 'oldDelivery': 8281.0, 'sitecode': u'2212'}, 14129150: {'newDelivery': '7099.000', 'grade': u'Diesel', 'timestamp': datetime.datetime(2019, 6, 24, 0, 0), 'tanksystemid': 8724, 'oldDelivery': 7099.0, 'sitecode': u'2328'}, 14129565: {'newDelivery': '16619.100', 'grade': u'Unleaded', 'timestamp': datetime.datetime(2019, 6, 24, 0, 0), 'tanksystemid': 10012, 'oldDelivery': 16619.1, 'sitecode': u'4217'}}
  </code></pre>