EditPythonScript?


#1

Is Python scripting available on the Mac yet? How do I define/invoke scripts?


#2

You can run Python scripts on the mac, but there is no editor/debugger available yet.

To run a script, use either RunPythonScript and browse to the script (.py) file somewhere on the computer, or -RunPythonScript scriptfilename where scriptfilename is the name of the script file stored on your computer in the python “Scripts” folder. Right now that folder is a hidden folder, so it’s somewhat hard to navigate to.

Also: beware, the Python version currently on the Mac is not up to date, so some scripts that run in Windows will not run on Mac yet.

–Mitch


#3

a bit off topic but fwiw, that folder hasn’t always been hidden on osx… starting with 10.7, it has been hidden by default… you can unhide it via terminal.app by entering:
chflags nohidden ~/Library/

in mavericks, they’ve made it a little more user friendly to unhide… click on your user folder in finder then View-> Show view options (⌘J) …check the box ‘show library folder’

then the path to the scripts folder is
~(user)/ Library/ Application Support/ McNeel/ Rhinoceros/ Scripts


#4

Thanks for that info Jeff! --Mitch


#5

Thank you both.

FWIW Rhino may use its own Python. I wrote a pythonversion.py script which prints “2.7.5 (default, Aug 2 2013, 16:40:47) …” locally, but “2.7.0 ()” when run with RunPythonScript.


(Steve Baer) #6

Yes Rhino does run it’s own version of an embedded python interpreter.


#7

Another interesting feature of the Finder in Mavericks is that by dropping down the “Go” menu, you’ll notice it doesn’t show the Library folder, but if you you press the “Option” key it pops onto the list.