Grasshopper

algorithmic modeling for Rhino

Everything seems right about this code to me, and I tested it in an outside Python editor with no problem. I'm getting an 'expected index value, got float' when there are clearly no floats involved. Type hint is set to 'int' as shown in the image. This seems like a bug, or am I missing something?

Views: 866

Replies to This Discussion

Cast x/2 to an integer.

i = int(x/2)

a = randlist[:i]

b = randlist[i:]

You just saved me some frustration, many thanks. 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service