<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_system(filename, format=None):
    '''Write the system currently displayed to a file.'''
    datafile(filename, format=format, mode='w').write('system',
                                                      current_system())