def save_to_file(cn_topo, filename):
    '''
    Save a topology to a file.
    '''
    jstr = cn_topo.serialize()
    with open(filename, 'w') as outfile:
        outfile.write(jstr)
def save_to_file ( cn_topo , filename ) : jstr = cn_topo . serialize ( ) with open ( filename , 'w' ) as outfile : outfile . write ( jstr )
Save a topology to a file.