Running A grasshopperscript from Python

Hi All,

I’m trying to create a Python script (not running inside grasshopper but in an external IDE) that opens up Rhino, a grasshopper script and runs that script.
I’ve been experimenting with the subprocess packge in python with some succes but I feel like it is not a very robust solution since popups or errors are very hard to catch using this method.
I would prefer having some kind of connection to the Rhino API from my external Python IDE to start and run grasshopper scripts. I could use the grasshopper script itself to write the data to somewhere so I can use it again with my external Python script.

Can anyone tell me if this is possible/point me in the right direction?
Thanks in advance!

Daan

Sounds like a job for rhino inside CPython but I haven’t tried this…