thirdparty/python-graph/examples/read.py
changeset 594 06c2228e39cb
equal deleted inserted replaced
593:01f8c7aabb7e 594:06c2228e39cb
       
     1 #!/usr/bin/env python
       
     2 
       
     3 # Copyright (c) 2007-2008 Pedro Matiello <pmatiello@gmail.com>
       
     4 # License: MIT (see COPYING file)
       
     5 
       
     6 import sys
       
     7 sys.path.append('..')
       
     8 import graph
       
     9 
       
    10 gr = graph.graph()
       
    11 
       
    12 inputfile = file('graph.xml','r')
       
    13 string = inputfile.read()
       
    14 inputfile.close()
       
    15 
       
    16 gr.read(string)
       
    17 print gr.write()