In Python, what does pydoc do?

New to programming and python in general. In the book that I am studying, the author suggested that I know the purpose of Pidok.

I did a Google search and found a match (from Gnome Terminal), but that didn't make much sense to me. Does any mind simplify a little? Thanks.

+11
source share
9 answers

Pydoc is a help / documentation module for Python.

Use this on your Windows terminal to understand what the function does in python:

python -m pydoc <function>

eg.

python -m pydoc raw_input

If the documentation for a particular function is very long, use "q" to exit it.

eg. when

python -m pydoc Tkinter
+10
source

Pydoc - Python. , Pydoc, .

+2

pydoc Python. ​​ , - HTML.

, , docstring (.. doc) . docstring , pydoc , .

Python - Python 2.7 - Python 3.5 - Python 3.6

+1

Pydoc Python HTML-

python -m pydoc 

, pydoc, -k , -p - Python, -g , -w HTML. , .

python -m pydoc yourpythonfile
python -m pydoc -k ftplib
python -m pydoc -p 314
python -m pydoc -w file

file1.py file2.py, .

def f2m(ft):
    """ Return the number of meters eq to feet """
    return 0.30 * ft

- , python file.py, .

help(f2m)

-

python -m pydoc file1

html-, html

python -m pydoc -w <dir>

Python HTML , . "htmldocs", html . , , .

mkdir -p htmldocs
pydoc -w 'find . -name '*.py''
mv *.html htmldocs
+1

, Python, pydoc - , . :

> python -m pydoc 'function'

:

> python -m pydoc open

:

(...)    ( [, [, ]]) →

Open a file using the file() type, returns a file object.  This is the
preferred way to open a file.  See file.__doc__ for further information. <<<

, !

0

, Wikipedia: "Pydoc Python Python, HTML- ".

-1

pydoc , python. ! :)

-1

pydoc generates documentation from python modules in Windows 10, go to the cmd / terminal type prompt python -m pydoc, for example: python -m pydoc sys

-1
source

Source: https://habr.com/ru/post/1525526/


All Articles