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

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