You might want to check out this thread:
I’ve made some progress in launching GH headless from a python script and controlling the GH definition using HumanUI.