analitics

Pages

Saturday, August 31, 2024

Python 3.13.0rc1 : Using pydoc python module.

This is default python module.
You can find pydoc - documentation.
Simple use of this python module for example: sys python module to see the documentation.
PythonProjects\test_pydoc>python -m pydoc sys
Using the w argument willcreate a HTML file with the documentation.
In this example will be sys.html, because is sys python module.
PythonProjects\test_pydoc>python -m pydoc -w sys
wrote sys.html
Best feature is search by word and show the result as python modules, in this case will show a list ...
PythonProjects\test_pydoc>python -m pydoc -k url
nturl2path - Convert a NT pathname to a file URL and vice versa.
test_sqlite3: testing with SQLite version 3.45.3
test.test_urllib - Regression tests for what was in Python 2's "urllib" module
test.test_urllib2
test.test_urllib2_localnet
test.test_urllib2net
Share the documentation with an server, in this case is set to localhost:
\PythonProjects\test_pydoc>python -m pydoc -p 1234
Server ready at http://localhost:1234/
Server commands: [b]rowser, [q]uit
You can create your python module script named test.py formated and then use pydoc.
"""
my python module
====
This is documentation
"""
def test():
"""
Function test
"""
    print("test")
Use this to show the text from your python source script module:
python -m pydoc test
PythonProjects\test_pydoc>python -m pydoc test
Help on module test:

NAME
    test

FILE
...