En Thu, 27 Sep 2007 13:52:39 -0300, Piyush Jain <[EMAIL PROTECTED]>  
escribi�:

>> I am new(almost) to python. I wish to making a server in which I can
>> make changes at run time. For example , add a method to a
>> class/attribute to object etc. by sending it messages.

To add a new attribute with a name known only at runtime, use setattr  
<http://docs.python.org/lib/built-in-funcs.html> either on the class (will  
be a class attribute then) or any individual instance.
To create a new method, just assign a function to the class.
I'd suggest first learning a bit more about Python until you are more  
fluent with the language. (And consider the risk of executing untrusted  
code from the outside).

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to