i am following 'dive into python' for learning. i come across a term getattr() which gives reference about a function.Its written it can be used as a dispatcher. Below example given for that builtin function: import statsout def output(data,format='text'): output_function = getattr(statsout,"output_%s" % format) return output_function(data) Actually i installed python 2.5 i ran this script and its showing error it could not import statsout.why is it so?could any one explain this script briefly. i dont know whether i am following the right book. as i am a beginner is it right to follow this book?or is there any other book which is best for beginners?
-- Vanam
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor