Grasshopper

algorithmic modeling for Rhino

hello,

I am trying to input a list of dictionaries to my python component. however I don't know how to make it understand that the type is a list,so it can iterate through it.any thoughts?

I guess it is considering the input as a string rather than a list, is there a way to fix this?for example also I was hoping this list item would give me the members of the list,but it doesnt

Views: 1505

Replies to This Discussion

You can split the string into items!

Attachments:

yay it worked,thank you

thank you for the code, it workeeeed! happpy!happy!

Hi Nazanin - 

the text you're feeding in will always be interpreted as a string  - but if you need to convert it to a python object you can work with (a list of dictionaries or whatever else) you can use the built-in "eval" function.

thanks for the response,that is the first thing I thought of, however,the numbers that I need to access can be 1 digit or more,(depending on the user's input),so I dont know which element to get or slice the list from which element to which. 

oh i just reallized what you said, you were right!thank you

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