

I’m noticing the autocomplete is VERY picky and if there’s so much as a missed Uppercase vs lowercase character the code won’t run. Will move them to application support for now as others have mentioned. I installed the Atom thing, and have noticed the bit of having to CD in terminal before launching atom to get my scripts to show up. The example script: import mylib.myscript as sīeing able to configure the search path is important and we’ll add it sooner than later but in the meantime I hope this workaround is useful.Ĭool. If in the previous example the mylib directory is somewhere that’s not on the path you’d do something like this: mkdir /somepath/mylibĬd ~/Library/Application\ Support/McNeel/Rhinoceros/Scripts If your library is in a directory that is not under a search path you can create a link to it from /Users/NAME/Library/Application\ Support/McNeel/Rhinoceros/Scripts. You can now import your module from a script that’s in ~/py. ex: cd ~/pyĮcho "def doit(): print 'doit'" > myscript.py #simple script Let’s say your working directory is ~/py. Subdirectories need to have a _init_.py file so they are recognised as modules.


That means you can’t import modules that are not under: /Users/NAME/Library/Application\ Support/McNeel/Rhinoceros/Scripts or not in the directory or a subdirectory of the file you’re currently running. One current limitation is that the python search path is not configurable. Your scripts can reside anywhere but if they are not on the search path they can’t be imported by other scripts. I’m not sure this is any better than the post I just deleted but here it goes …
