def print_output(results):
 print '\nSuccessful devices:'
 for a_dict in results:
  for (identifier, val) in a_dict.iteritems():
   (success, out_string) = val
   if success:
    print '\n\n'
    print ('#' * 80)
    print 'Device = {0}\n'.format(identifier)
    print out_string
    print ('#' * 80)
 print '\n\nFailed devices:\n'
 for a_dict in results:
  for (identifier, val) in a_dict.iteritems():
   (success, out_string) = val
   if (not success):
    print 'Device failed = {0}'.format(identifier)
 print ('\nEnd time: ' + str(datetime.now()))
 print

def print_output ( results ) : print '\nSuccessful devices:' for a_dict in results : for ( identifier , val ) in a_dict . iteritems ( ) : ( success , out_string ) = val if success : print '\n\n' print ( '#' * 80 ) print 'Device = {0}\n' . format ( identifier ) print out_string print ( '#' * 80 ) print '\n\nFailed devices:\n' for a_dict in results : for ( identifier , val ) in a_dict . iteritems ( ) : ( success , out_string ) = val if ( not success ) : print 'Device failed = {0}' . format ( identifier ) print ( '\nEnd time: ' + str ( datetime . now ( ) ) ) print
display output .