<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_row(dictionary, card, log):
 """ Processes a single row from the file. """

    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'