Re: passing variables as object attributes

2010-08-17 Thread Vikas Mahajan
I got the concept to get and set object attributes and now can handle similar problems effectively. Thanks to all for your help. -- http://mail.python.org/mailman/listinfo/python-list

Re: passing variables as object attributes

2010-08-17 Thread Bruno Desthuilliers
Vikas Mahajan a écrit : On 16 August 2010 19:23, Nitin Pawar 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 scr

Re: passing variables as object attributes

2010-08-16 Thread Terry Reedy
On 8/16/2010 9:40 AM, Vikas Mahajan wrote: Hello to all I am new to python. Hi, welcome to Python. Hint 1: 'Variable' is a rather loose term with many meanings. Better to think in terms of 'name' ('identifier'), which is specifically defined, and 'object'. I am facing problem to use varia

Re: passing variables as object attributes

2010-08-16 Thread Vikas Mahajan
@All Thanks a lot. getattr and setattr functions solved my problem. -- http://mail.python.org/mailman/listinfo/python-list

Re: passing variables as object attributes

2010-08-16 Thread Jean-Michel Pichavant
Vikas Mahajan wrote: On 16 August 2010 19:23, Nitin Pawar 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 pytho

Re: passing variables as object attributes

2010-08-16 Thread misterdi
On Aug 16, 8:40 pm, Vikas Mahajan wrote: > Hello to all > > I am new to python. I am facing problem to use variables as object > attributes. I have to use loop and dynamically add attributes to a > object and for this purpose I have to use variables with object names. > > For example-: > Let us sa

Re: passing variables as object attributes

2010-08-16 Thread nn
On Aug 16, 10:08 am, Vikas Mahajan wrote: > On 16 August 2010 19:23, Nitin Pawar 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 obj

Re: passing variables as object attributes

2010-08-16 Thread nn
On Aug 16, 10:08 am, Vikas Mahajan wrote: > On 16 August 2010 19:23, Nitin Pawar 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 obj

Re: passing variables as object attributes

2010-08-16 Thread Vikas Mahajan
On 16 August 2010 19:23, Nitin Pawar 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 softwa

Re: passing variables as object attributes

2010-08-16 Thread Nitin Pawar
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 On Mon, Aug 16, 2010 at 7:10 PM, Vikas Mahajan wrote: > Hello to all > > I am new to python. I am facing problem to use variables as object > attributes.