GH python 3.3 available?

hello guys,

I tried to use python function “List.copy()” but came up with error: _Runtime error (MissingMemberException): ‘list’ object has no attribute copy.

I searched online and found one answer is the python version should higher than 3.3 otherwise cannot use “copy()” function. So is there a higher version of GH python available or is there any way else to achieve the “copy()” function of list?

cheers,
Lei

Rhino uses the .NET implementation of Python called IronPython, this is still at version 2.7. If you need to copy something, you can use the copy module.

Hi Anders,

Thanks for the reply. Do I need import any lib inside GH Python component?
The error is “copy is not-defined”

You just import copy and call one of the methods, like so:

2018-12-09%2011_56_01-Grasshopper%20Python%20Script%20Editor

(using id() here to verify that we did indeed make a copy)

2 Likes

Cool! Thank you so much!