|
From: | Tamas Nepusz |
Subject: | Re: [igraph] add edges in python igraph |
Date: | Mon, 19 Jan 2009 22:51:19 +0000 |
...which is fine, since you can easily catch the exception and handle it using Python's standard exception handling mechanism:the problem with get_eid() is that if the edge doesn't exist, it returns an error...
try: edge_id = g.get_eid((1,2)) except: edge_id = g.ecount() g.add_edges((1,2)) -- Tamas
[Prev in Thread] | Current Thread | [Next in Thread] |