Grasshopper

algorithmic modeling for Rhino

Hello, I need to deep copy a list in a ghpython script I am writing, but it doesn't seem that the version of IronPython used in grasshopper has the copy module available. Is it possible to install the copy module for IronPython or do I have to instead manually duplicate the list as I have been doing? 

What I would like to do:

import copy

L1 = [1, 2, 3]

L2 = copy.deepcopy(L1)

What I am currently doing:

L1 = [1, 2, 3]

L2 = [1, 2, 3]

Views: 768

Replies to This Discussion

copy should be present in ironpython version 2.6 or later - I think gh ships with at least 2.7. it doesn't show up in the autocomplete menu for me but your code in the "would like to do" section executes just fine in gh python. 

Hmm that explains it. Thanks for reply. I just assumed that since it didn't show up in the autocomplete menu that it wouldn't work, haha.

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