Can't find any info on Python's read() method (python 2.7)
Question: I'm trying to learn Python by going through Zed Shaw's "Learn Python the hard
way" and I'm stuck at what may seem as a very trivial thing. I'm unable to
find any info on the .read() method. This is what he says in the book:

> Run pydoc file and scroll down until you see the .read() command
> (method/function). See all the other ones you can use? Skip the ones that
> have __ (two underscores) in front because those are junk. Try some of the
> other commands.

If I call `python -m pydoc` I only get a very short list of information
regarding `pydoc.py`, `pydoc.py -k`, `pydoc.py -p`, `pydoc.py -g`, and
`pydoc.py -w`

When I tried calling `python -m pydoc read` I got the following message:

> no Python documentation found for 'read'

Is the `.read` method embedded in Python by default or does it have to be
imported first? I should note that I'm using Powershell on Windows 7. What
could be the problem here?


Answer: `read` is a method on file objects. Use:

    
    
    python -m pydoc file
    

to get the documentation for file objects. Note that this is exactly what the
book told you to do, but it appears you left of the `file` argument.

Alternatively, ask for just the method:

    
    
    python -m pydoc file.read
    

The official documentation, however, is far richer and useful. See the
documentation on [_File
Objects_](https://docs.python.org/2/library/stdtypes.html#file-objects) for
example.

