Rhino will run this script from the script editor, but not from the command line or button with -runpythonscript. Seems like it should. It does work if I run from a button using _-ScriptEditor _Run. Is that the prefered way to run a python script? I’ve always used RunPythonScript.
This script doesn’t do anything - just an example showing error.
@phcreates Yes the _-ScriptEditor _Run can run scripts of any language supported by the script editor. See here. RunPythonScript is a bit older and runs python scripts with the older IronPython engine unless script file starts with #! python 3. Then it uses the new python3.
Do you see an error when running from command prompt or nothing happens? Are you on macOS or windows? Your rhino version would be super handy to paste here.
I’m on windows and running both V8 and V9. When I run it from a button or command prompt, I get an error. But you’re correct - if I add #! python 3 at the top, then it’s all fine. Does it matter from a performance perspective whether I use -RunPythonScript or -ScriptEditor _Run?