@open_file(1, mode='wb')
def write_pajek(G, path, encoding='UTF-8'):
 for line in generate_pajek(G):
  line += '\n'
  path.write(line.encode(encoding))

@ open_file ( 1 , mode = 'wb' ) def write_pajek ( G , path , encoding = 'UTF-8' ) : for line in generate_pajek ( G ) : line += '\n' path . write ( line . encode ( encoding ) )
write graph in pajek format to path .