how to create this dependency table from ast?

Ho Yeung Lee jobmattcon at gmail.com
Sun Jul 2 09:28:35 EDT 2017


i find parseprint function not exist in python 2.7

goal is to create a table

graph = {'A': ['B', 'C'],
             'B': ['C', 'D'],
             'C': ['D'],
             'D': ['C'],
             'E': ['F'],
             'F': ['C']}

from

a = 1
b = 1
c = a + b
d = c
e = c

file = open(r"C:\Users\hello\Documents\testingsource.py", "r")
root = ast.parse(file.read())

a   b
 \ /
  c
 / \
d   e




More information about the Python-list mailing list