Jun-19-2024, 02:11 PM
after i research, i get what i aim
#the data created by other py, this only show how to produce graph from graphviz import Digraph import sqlite3 f = Digraph('neato', format='png', encoding='utf8', filename='cp2077', node_attr={'color': 'lightblue2', 'style': 'filled'}) f.attr('node', shape='box') con = sqlite3.connect("CB2077.db") cur = con.cursor() cur.execute("CREATE TABLE IF NOT EXISTS TbFlow (PreviousQuest TEXT, NextQuest TEXT)") command = "SELECT * FROM TbFlow" results = cur.execute(command).fetchall() for result in results: print(result) f.edge(result[0], result[1], label='') f.view()[attachment=2919]