How to call python script in UIVision

I see the mistake in your code. You are calling the Python command line wrong. The syntax is C:\python27\python.exe Z:\yourcode\yourscript.py.

Example: The Python script takes the input, squares it and returns it via exit code:

Python script:

# XRUN Python V1.0

import sys

#get command line value
i = int (sys.argv[1])

#Square it!
i = i * i

# exit code in Python (limited to value between 0...255)
sys.exit(i)

Python RPA:

{
  "Name": "python test",
  "CreationDate": "2020-2-15",
  "Commands": [
    {
      "Command": "store",
      "Target": "5",
      "Value": "a"
    },
    {
      "Command": "XRunAndWait",
      "Target": "C:\\python27\\python.exe ",
      "Value": "c:\\test\\square.py ${a}"
    },
    {
      "Command": "echo",
      "Target": "exitcode=${!xrun_exitcode}",
      "Value": "green"
    }
  ]
}

Same for VBS here: Problem with xrun when running batch file with bat extension or converted exe file - #9 by ulrich