From 048891d8fee5a95555afdab011ec389430c39564 Mon Sep 17 00:00:00 2001 From: ramvikrams Date: Thu, 29 Dec 2022 01:13:13 +0530 Subject: [PATCH 1/5] Update pydoc.rst --- Doc/library/pydoc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst index 94daf4a58f9c24..7e7ed6f2621e22 100644 --- a/Doc/library/pydoc.rst +++ b/Doc/library/pydoc.rst @@ -33,7 +33,7 @@ as text on the console. The same text documentation can also be viewed from outside the Python interpreter by running :program:`pydoc` as a script at the operating system's command prompt. For example, running :: - pydoc sys + -m pydoc sys at a shell prompt will display documentation on the :mod:`sys` module, in a style similar to the manual pages shown by the Unix :program:`man` command. The From b919b5bb2d2e0795e255a40e7333ac283fcbc5c8 Mon Sep 17 00:00:00 2001 From: ramvikrams Date: Thu, 29 Dec 2022 10:21:11 +0530 Subject: [PATCH 2/5] Update pydoc.rst --- Doc/library/pydoc.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst index 7e7ed6f2621e22..19f75142529488 100644 --- a/Doc/library/pydoc.rst +++ b/Doc/library/pydoc.rst @@ -33,13 +33,13 @@ as text on the console. The same text documentation can also be viewed from outside the Python interpreter by running :program:`pydoc` as a script at the operating system's command prompt. For example, running :: - -m pydoc sys + -m pydoc sys at a shell prompt will display documentation on the :mod:`sys` module, in a style similar to the manual pages shown by the Unix :program:`man` command. The -argument to :program:`pydoc` can be the name of a function, module, or package, +argument to :program:` -m pydoc` can be the name of a function, module, or package, or a dotted reference to a class, method, or function within a module or module -in a package. If the argument to :program:`pydoc` looks like a path (that is, +in a package. If the argument to :program:` -m pydoc` looks like a path (that is, it contains the path separator for your operating system, such as a slash in Unix), and refers to an existing Python source file, then documentation is produced for that file. @@ -51,9 +51,9 @@ produced for that file. executed on that occasion. Use an ``if __name__ == '__main__':`` guard to only execute code when a file is invoked as a script and not just imported. -When printing output to the console, :program:`pydoc` attempts to paginate the +When printing output to the console, :program:` -m pydoc` attempts to paginate the output for easier reading. If the :envvar:`PAGER` environment variable is set, -:program:`pydoc` will use its value as a pagination program. +:program:` -m pydoc` will use its value as a pagination program. Specifying a ``-w`` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text @@ -65,25 +65,25 @@ manner similar to the Unix :program:`man` command. The synopsis line of a module is the first line of its documentation string. You can also use :program:`pydoc` to start an HTTP server on the local machine -that will serve documentation to visiting web browsers. :program:`pydoc -p 1234` +that will serve documentation to visiting web browsers. :program:` -m pydoc -p 1234` will start a HTTP server on port 1234, allowing you to browse the documentation at ``http://localhost:1234/`` in your preferred web browser. Specifying ``0`` as the port number will select an arbitrary unused port. -:program:`pydoc -n ` will start the server listening at the given +:program:` -m pydoc -n ` will start the server listening at the given hostname. By default the hostname is 'localhost' but if you want the server to be reached from other machines, you may want to change the host name that the server responds to. During development this is especially useful if you want to run pydoc from within a container. -:program:`pydoc -b` will start the server and additionally open a web +:program:` -m pydoc -b` will start the server and additionally open a web browser to a module index page. Each served page has a navigation bar at the top where you can *Get* help on an individual item, *Search* all modules with a keyword in their synopsis line, and go to the *Module index*, *Topics* and *Keywords* pages. -When :program:`pydoc` generates documentation, it uses the current environment -and path to locate modules. Thus, invoking :program:`pydoc spam` +When :program:` -m pydoc` generates documentation, it uses the current environment +and path to locate modules. Thus, invoking :program:` -m pydoc spam` documents precisely the version of the module you would get if you started the Python interpreter and typed ``import spam``. From 3dd3795cb576becb6b06a90fab88ec436175ec52 Mon Sep 17 00:00:00 2001 From: ramvikrams Date: Thu, 29 Dec 2022 12:11:48 +0530 Subject: [PATCH 3/5] Update pydoc.rst --- Doc/library/pydoc.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst index 19f75142529488..dd9a6a428e45f5 100644 --- a/Doc/library/pydoc.rst +++ b/Doc/library/pydoc.rst @@ -33,13 +33,13 @@ as text on the console. The same text documentation can also be viewed from outside the Python interpreter by running :program:`pydoc` as a script at the operating system's command prompt. For example, running :: - -m pydoc sys + python -m pydoc sys at a shell prompt will display documentation on the :mod:`sys` module, in a style similar to the manual pages shown by the Unix :program:`man` command. The -argument to :program:` -m pydoc` can be the name of a function, module, or package, +argument to :program:`python -m pydoc` can be the name of a function, module, or package, or a dotted reference to a class, method, or function within a module or module -in a package. If the argument to :program:` -m pydoc` looks like a path (that is, +in a package. If the argument to :program:`python -m pydoc` looks like a path (that is, it contains the path separator for your operating system, such as a slash in Unix), and refers to an existing Python source file, then documentation is produced for that file. @@ -51,9 +51,9 @@ produced for that file. executed on that occasion. Use an ``if __name__ == '__main__':`` guard to only execute code when a file is invoked as a script and not just imported. -When printing output to the console, :program:` -m pydoc` attempts to paginate the +When printing output to the console, :program:`python -m pydoc` attempts to paginate the output for easier reading. If the :envvar:`PAGER` environment variable is set, -:program:` -m pydoc` will use its value as a pagination program. +:program:`python -m pydoc` will use its value as a pagination program. Specifying a ``-w`` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text @@ -65,25 +65,25 @@ manner similar to the Unix :program:`man` command. The synopsis line of a module is the first line of its documentation string. You can also use :program:`pydoc` to start an HTTP server on the local machine -that will serve documentation to visiting web browsers. :program:` -m pydoc -p 1234` +that will serve documentation to visiting web browsers. :program:`python -m pydoc -p 1234` will start a HTTP server on port 1234, allowing you to browse the documentation at ``http://localhost:1234/`` in your preferred web browser. Specifying ``0`` as the port number will select an arbitrary unused port. -:program:` -m pydoc -n ` will start the server listening at the given +:program:`python -m pydoc -n ` will start the server listening at the given hostname. By default the hostname is 'localhost' but if you want the server to be reached from other machines, you may want to change the host name that the server responds to. During development this is especially useful if you want to run pydoc from within a container. -:program:` -m pydoc -b` will start the server and additionally open a web +:program:`python -m pydoc -b` will start the server and additionally open a web browser to a module index page. Each served page has a navigation bar at the top where you can *Get* help on an individual item, *Search* all modules with a keyword in their synopsis line, and go to the *Module index*, *Topics* and *Keywords* pages. -When :program:` -m pydoc` generates documentation, it uses the current environment -and path to locate modules. Thus, invoking :program:` -m pydoc spam` +When :program:`python -m pydoc` generates documentation, it uses the current environment +and path to locate modules. Thus, invoking :program:`python -m pydoc spam` documents precisely the version of the module you would get if you started the Python interpreter and typed ``import spam``. From 7e36557730c067849d6f3ae81295dc53573d25c1 Mon Sep 17 00:00:00 2001 From: ramvikrams Date: Thu, 29 Dec 2022 12:15:38 +0530 Subject: [PATCH 4/5] Update pydoc.rst --- Doc/library/pydoc.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst index dd9a6a428e45f5..0c6d67cb2ff945 100644 --- a/Doc/library/pydoc.rst +++ b/Doc/library/pydoc.rst @@ -37,9 +37,9 @@ operating system's command prompt. For example, running :: at a shell prompt will display documentation on the :mod:`sys` module, in a style similar to the manual pages shown by the Unix :program:`man` command. The -argument to :program:`python -m pydoc` can be the name of a function, module, or package, +argument to :program:`pydoc` can be the name of a function, module, or package, or a dotted reference to a class, method, or function within a module or module -in a package. If the argument to :program:`python -m pydoc` looks like a path (that is, +in a package. If the argument to :program:`pydoc` looks like a path (that is, it contains the path separator for your operating system, such as a slash in Unix), and refers to an existing Python source file, then documentation is produced for that file. @@ -51,9 +51,9 @@ produced for that file. executed on that occasion. Use an ``if __name__ == '__main__':`` guard to only execute code when a file is invoked as a script and not just imported. -When printing output to the console, :program:`python -m pydoc` attempts to paginate the +When printing output to the console, :program:`pydoc` attempts to paginate the output for easier reading. If the :envvar:`PAGER` environment variable is set, -:program:`python -m pydoc` will use its value as a pagination program. +:program:`pydoc` will use its value as a pagination program. Specifying a ``-w`` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text @@ -82,8 +82,8 @@ top where you can *Get* help on an individual item, *Search* all modules with a keyword in their synopsis line, and go to the *Module index*, *Topics* and *Keywords* pages. -When :program:`python -m pydoc` generates documentation, it uses the current environment -and path to locate modules. Thus, invoking :program:`python -m pydoc spam` +When :program:`pydoc` generates documentation, it uses the current environment +and path to locate modules. Thus, invoking :program:`pydoc spam` documents precisely the version of the module you would get if you started the Python interpreter and typed ``import spam``. From a94c4e9618aa27f6dea13ce31660ec203f5aaed1 Mon Sep 17 00:00:00 2001 From: ram vikram singh Date: Thu, 29 Dec 2022 15:31:04 +0530 Subject: [PATCH 5/5] Update pydoc.rst --- Doc/library/pydoc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst index 0c6d67cb2ff945..03e0915bf6d135 100644 --- a/Doc/library/pydoc.rst +++ b/Doc/library/pydoc.rst @@ -65,7 +65,7 @@ manner similar to the Unix :program:`man` command. The synopsis line of a module is the first line of its documentation string. You can also use :program:`pydoc` to start an HTTP server on the local machine -that will serve documentation to visiting web browsers. :program:`python -m pydoc -p 1234` +that will serve documentation to visiting web browsers. :program:`python -m pydoc -p 1234` will start a HTTP server on port 1234, allowing you to browse the documentation at ``http://localhost:1234/`` in your preferred web browser. Specifying ``0`` as the port number will select an arbitrary unused port.