Skip to content
April 22, 2010 / stevebaer

New Rhino V5 WIP – Python Batteries Included

python powered

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: