Why doesn't response pydoc on my Python 2.7?
Robert
rxjwg98 at gmail.com
Sat Dec 12 18:08:48 EST 2015
On Saturday, December 12, 2015 at 6:02:11 PM UTC-5, Robert wrote:
> Hi,
>
> I want to use pydoc as some online tutorial shows, but it cannot run as
> below. What is wrong?
>
>
> Thanks,
>
>
>
>
> >>> import pydoc
> >>> pydoc
> <module 'pydoc' from 'C:\Python27\lib\pydoc.pyc'>
> >>> pydoc sys
> SyntaxError: invalid syntax
> >>> import sys
> >>> pydoc sys
> SyntaxError: invalid syntax
> >>> help(pydoc)
> Help on module pydoc:
> ......
In fact, I wanted to run the following code. When it failed, I moved to
the original question above.
Anyone can help? Thanks,
//////////
It also changes what pydoc will show:
module1.py
a = "A"
b = "B"
c = "C"
module2.py
__all__ = ['a', 'b']
a = "A"
b = "B"
c = "C"
$ pydoc module1
More information about the Python-list
mailing list