Prerequisite
Python installed on the local system
test.py
Answer
Use Godot's OS.execute()
function which is similar in operation to Python's Subprocess
var pystdout
OS.execute("python", ["path_to_test.py"], true, pystdout)
print(pystdout)
Need-to-know
Avoid calling this function on the main thread as inorder to get output, execution is blocked until python is finished
Reference
OS.Execute()