sys.stdout.write()

Daniel Klein DanielK at aracnet.com
Tue Dec 19 17:36:50 CET 2000


In 'Learning Python' by Mark Lutz and David Ascher, on page 77 it makes
mention of the 'sys.stdout.write' method. However, when I check this out, I
don't see the 'write' method in the list...

>>> import sys
>>> dir(sys.stdout)
['shell', 'softspace', 'tags']

I must be doing something fundamentally wrong. :^(

I guess this brings up the bigger question of self help. Is there an easy or
prescribed way to find out what module (or class) a particular method is
implemented in?

As a side (but related) issue, the current online reference material does
not always indicate all of the exceptions thrown by a method or function.
What is the best way to determine this when writing code?

Thanks,
Daniel Klein







More information about the Python-list mailing list