code: def write_row(dictionary, card, log):
      
      rowhdr = {'card': card, 'log': log}
  
      # Do this as a list of 1-char strings.
      # Can't use a string b/c strings are immutable.
      row = [' '] * 80
  
      # Make the row header.
      for e in ['log', 'card']:
          strt, stop, item = _put_field(cols(0), e, rowhdr[e])
          if item is not None:
              row[strt:stop] = list(item)
  
      # Now make the rest of the row.
      for field in cols(card):
          strt, stop, item = _put_field(cols(card), field, dictionary.get(field))
          if item is not None:
              row[strt:stop] = list(item)
  
      return ''.join(row) + '\n'
docs: Processes a single row from the file.