Is it possible to pass arguments to RunPythonScript?

I’m trying to spawn multiple Rhino instances with a python script and make them load the same script that started them, but run it differently. I thought that it can be achieved by passing arguments to -RunPythonScript command like this:

-RunPythonScript ("C:\\Scripts\\test.py -testytestytest")

test.py:

import sys

print(sys.argv[1])

but this error pops up:
image

A workaround:

# when calling subprocess Popen
/runscript="-SetDocumentUserText Key Value -RunPythonScript ("C:\\Scripts\\test.py")

test.py

import rhinoscript as rs

print(rs.GetDocuementUserText("Key"))

image

1 Like