@open_file(1, mode='wb')
def write_multiline_adjlist(G, path, delimiter=' ', comments='#', encoding='utf-8'):
 import sys
 import time
 pargs = (comments + ' '.join(sys.argv))
 header = (((('{}\n'.format(pargs) + comments) + ' GMT {}\n'.format(time.asctime(time.gmtime()))) + comments) + ' {}\n'.format(G.name))
 path.write(header.encode(encoding))
 for multiline in generate_multiline_adjlist(G, delimiter):
  multiline += '\n'
  path.write(multiline.encode(encoding))

@ open_file ( 1 , mode = 'wb' ) def write_multiline_adjlist ( G , path , delimiter = ' ' , comments = '#' , encoding = 'utf-8' ) : import sys import time pargs = ( comments + ' ' . join ( sys . argv ) ) header = ( ( ( ( '{}\n' . format ( pargs ) + comments ) + ' GMT {}\n' . format ( time . asctime ( time . gmtime ( ) ) ) ) + comments ) + ' {}\n' . format ( G . name ) ) path . write ( header . encode ( encoding ) ) for multiline in generate_multiline_adjlist ( G , delimiter ) : multiline += '\n' path . write ( multiline . encode ( encoding ) )
write the graph g in multiline adjacency list format to path parameters g : networkx graph comments : string .