New Rhino V5 WIP – Python Batteries Included
The April 22, 2010 WIP of Rhino 5 (http://download.rhino3d.com/rhino/5.0/wip) includes the python standard library in the installation. Rhino’s python scripting engine is wired up to make this library available to all python scripts executing in Rhino. Script writers can use all of the functionality in the .NET framework that they have always had access to along with many of the modules built into the python standard library. More information on the python standard library can be found at http://docs.python.org/library/
We’re also working on getting the Mac version of the rhino python scripting engine to automatically find and support the python standard library.
Use the random module
import random # print some random integers between 1 and 100 for i in range(10): print random.randint(1,100)
Force floating point division
from __future__ import division # without the division setting, this would print 2 print 5/2
Leave a Reply