Re: [Tutor] Query about getattr used as a dispatcher

2007-01-17 Thread Kent Johnson
raghu raghu wrote: > i am following 'dive into python' for learning. 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? I don't think Dive Into Python is a great book for beginners

Re: [Tutor] Query about getattr used as a dispatcher

2007-01-17 Thread Chris Calloway
raghu raghu wrote: > Actually i installed python 2.5 i ran this script and its showing error > it could not import statsout. why is it so? statsout is a *hypothetical* module used for an example only. The statsout module does not actually exist. When Dive Into Python wants you to type in an exa

[Tutor] Query about getattr used as a dispatcher

2007-01-17 Thread raghu raghu
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(statsou