Change Default Content of Python Script Editor

I heavily use Python in Grasshopper and wanted to ask if there is a possibility to change the content of the default python node?
Currently I copy and paste from a *.txt like a caveman.

I found a 11 year old thread on this topic by @Helvetosaur, but without solution

Best Dan

I haven’t checked in the GH editor, but in ScriptEditor in Rhino 8 you can now make and store your own templates. I also asked for the possibility a couple of days ago to have a button to create a new blank file directly without a template like the older EditPythonScript does.

1 Like

Do you know where the default templates are stored?

Looking through C:\Users\...\.rhinocode\py39-rh8 and subfolders did not return any result.

Dunno, I just made some in the editor itself, no idea if they are actually stored as discreet files or just as settings in the editor itself.

maybe @eirannejad knows and can help!

I’m working on that.

1 Like

@dn.aur How about creating a script component, putting the template script in there, adding the template input and output parameters, and save it as a user object?

2 Likes

Thanks, this was the obvious solution I did not think of!

2 Likes

Hi @eirannejad! Sorry if i resume this thread: is there really not another way to create a template-script? I mean, building a user-object is already super-great, so it’s really just in case I want to make a list of templates and access them directly by the Python component.

And maybe related to this: is it possible to specify the Python exe or the Python version/path? so that as it does for the IronPython or CPython, I’d like the language of the active code to point at a python inside a virtual env, for example.

  • User-objects are currently the way for templates but I have tickets to add support for custom templates inside the editor as well
  • Rhino is designed to work with the python interpretter that is shipped with it.
1 Like

Ok thanks! good to know!

1 Like