Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi Fedelbc, thanks for reminding me update my question! :)

Here is the error I got:

sage: def my_digraph(filename):
          f = open(filename, 'r')
          D=DiGraph(loops=True,multiedges=True)
          for c in f:
              c = c[1:-2]
              s1, g, s2 = c.split(', ')
              D.add_edge([ s1, s2, g ])
          f.close()
          return D
....:     
sage: graph = my_digraph("result")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/mount/autofs/home_stude/tsang/<ipython console> in <module>()

/mount/autofs/home_stude/tsang/<ipython console> in my_digraph(filename)

ValueError: need more than 1 value to unpack

Do you have any suggestions please? Thanks again for your kind help. :)