how to pass array as argument from blueprint widget graph to python script file?

I have started learning ue4 and python. Before the question, I have been using “UnrealEnginePython” plugin, not ue4 official python. I have asked in the “UnrealEnginePython” teams already, since there’s no response, thats why asking here.

I want to pass an array from Blueprint to python script. I can call python script by “execute python script” node. But i dont know how to pass argument.

On the other way, i tried to get the value of an array of blueprint from python. I can get it but the value is the default value. If i change the array value in BP then call python, python wont get the changed value, it always gets the default array value. If i could get the changed value, it could have solved the problem too.

I am so sorry as it is not directly related to official ue python but any help is welcome. Thank you.

You can use sys.argv to pass arguments to your scripts. It’s just as simple as separating all the items of the list with a space.

Here’s a simple snippet of code.

import sys

print(sys.argv[1:][0].split(' '))

Calling the script like this:

python path\to\ “a b c”

Would output:

['a', 'b', 'c']