Я пытаюсь вытащить изображения из местоположения, чтобы добавить его в мой определенный узел, используя graphviz, но узел выходит пустым. Кто-нибудь может предоставить решение? - PullRequest
0 голосов
/ 18 апреля 2020
import pydot                                        //add all libraries
import os
os.environ["PATH"] += os.pathsep + 'c:/Program Files (x86)/Graphviz2.38/bin/' //add path variable
import tkinter as tk                                    //add tkinter
from tkinter import simpledialog
ROOT = tk.Tk()
ROOT.withdraw()                                          
root = "Pydot"
import graphviz                           //graphviz imported
size = int(input('Enter size of array: '))               //user entering the size of the array
t=[]                                             //storing the entering values into a list
for x in range(size):             //based on entered size the  loop runs
    r=("file_"+str(x))
    r = simpledialog.askstring(title="Test", prompt="Enter your variable")  //enter variable string
    t.append(r)                      //add the variables to empty list 't'
from graphviz import Digraph                         //graphviz library
g = Digraph('G', filename='variable.gv')      //file name 
g.node('a',shape='none', label="", image="D:/graphviz_location/a.jpg") // path added to pull image of node A
for w in range(len(t)-1):        //the loop to create connections between the edges sequentially
   g.edge(t[w] ,t[w+1] )        //edge to edge connection
   g.view()                    //to view the graph

Я пытаюсь добавить изображение в узел а, вытягивая изображение из указанного c местоположения, но на выходе оно получается как пустой узел.

...