passing variables as object attributes
vikas.mahajan12 at gmail.com
Mon Aug 16 16:08:15 CEST 2010
On 16 August 2010 19:23, Nitin Pawar <nitinpawar432 at gmail.com> wrote:
> you would need to define a class first with its attiributes and then you may
> want to initiate the variables by calling the class initilializer
Actually I have to dynamically add attributes to a object. I am
writing python script for FreeCAD software. I am using loop to create
multiple cylinders and I am writing following code-:
cyname = "Cylinder"
And I am getting this error-:
AttributeError: 'App.Document' object has no attribute 'cyname'
But when I use Cylinder in place of cyname, I am not getting any error.
More information about the Python-list