igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] add edges in python igraph


From: Tamas Nepusz
Subject: Re: [igraph] add edges in python igraph
Date: Mon, 19 Jan 2009 22:51:19 +0000

the problem with get_eid() is that if the edge doesn't exist, it
returns an error...
...which is fine, since you can easily catch the exception and handle it using Python's standard exception handling mechanism:

try:
    edge_id = g.get_eid((1,2))
except:
    edge_id = g.ecount()
    g.add_edges((1,2))

--
Tamas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]