algorithmic modeling for Rhino
Hi, I'm sure this is a dumb question, but I'm new to Python and I am trying to generate random numbers in the Python Component. I've already tried:
import random
random.range(x,z)
but it doesn't seem to work in the component. It works in ironpython in Rhino itself but not the component. Hopefully this is a quick fix and just me making a beginers mistake, so please let me know if you know the answer. Thank you.
Tags:
I think there is nor random.range() command
You´re looking for random.uniform(a,b)
http://docs.python.org/2/library/random.html
This will work:
import random
a = random.uniform( x , y)
Welcome to
Grasshopper
© 2025 Created by Scott Davidson.
Powered by