def generate_edgelist(G, delimiter=' ', data=True):
    if data is True or data is False:
        for e in G.edges(data=data):
            yield delimiter.join(map(make_str,e))
    else:
        for u,v,d in G.edges(data=True):
            e=[u,v]
            try:
                e.extend(d[k] for k in data)
            except KeyError:
                pass # missing data for this edge, should warn?
            yield delimiter.join(map(make_str,e))
Generate a single line of the graph G in edge list format.
dataset/ETHPy150Open networkx/networkx/networkx/readwrite/edgelist.py/generate_edgelist