[BangPypers] calling instance of the other class.

learningpython learningpython at aol.com
Mon Jun 22 22:32:39 CEST 2009


Sorry Senthil and all,
I am sure, it's pretty easy but don't i am not able to catch it. In C, i
just pass the & of the another structure in the structure element, some
thing close. 

Here is what i do .. a class is defined as mentioned, now this class is
element of another class
class Send_Msg_req(msg):
     def __init__(self):
       self.usr_mac =< Earlier class defined > 
       self.msgtype = <blah>
       self.msgsize = <blah>
       self.order = ['usr_mac', 
                      'msgtype ',
                       'msgsize ']

Now i like your expertize in giving me tips so that i have to declare and
keep sending above this message over serial port, but each time with
different class.
I hope i made it bit more clear. Sorry for the confusion.


Senthil Kumaran-6 wrote:
> 
> On Mon, Jun 22, 2009 at 04:35:35AM -0700, learningpython wrote:
> 
>> Please can you tell me how to pass instance of above class as a member of
>> the new message created in similar lines with one of the elements is the
>> complete data above (instance of above class). 
>> 
>> I am encapsulating above message in a transport layer message.
>> 2. Now similarly, i would like given a choice to choose the instance of
>> other class as the i would like to pass  in other instance of class
>> similarly. 
> 
> I am totally confused by the description. :(
> 
> If you still not very comfortable with Class terminologies in Python,
> I would suggest you read any basic book (2-3 hours on the topic  would be
> enough)  and perhaps you may find, what you are trying to do is
> easy?
> 
> 
> 
> -- 
> Senthil
> I do not find in orthodox Christianity one redeeming feature.
> 		-- Thomas Jefferson
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
> 
> 

-- 
View this message in context: http://www.nabble.com/calling-instance-of-the-other-class.-tp24145716p24154873.html
Sent from the BangPypers - Bangalore Python Users Group mailing list archive at Nabble.com.



More information about the BangPypers mailing list