Python graph pairs doesn't work

Maybe someone can help me out. I am having trouble with my python script (which I generated in chatGPT).

If I have the list defined as the input “pairs” inside of the script then it works. However when I try to make “pairs” the “X” input it throws an error. Same exact data. I tried toggling the various type hints and so on.



pyhon input.gh (4.2 KB)

What you input via the Panel is a string. What you have in the script expects a list of lists.

The quickest way to get it to work is to use pairs = eval(x).

But you have to be careful, since that will evaluate any string passed in as Python.

1 Like

That was it, thank you soo much!