| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This folder provides the code examples for the Real Python tutorial Documenting Python Code: A Complete Guide.
Only the spreadsheet examples need third-party packages. Install them into a virtual environment with:
$ python -m pip install -r requirements.txtThe standalone examples run on Python 3.6 or later. The spreadsheet examples use the pinned pandas version, which requires Python 3.11 or later.
Inspect docstrings with help():
>>> from say_hello_v2 import say_hello
>>> help(say_hello)
Help on function say_hello in module say_hello_v2:
say_hello(name)
A simple function that says hello... Richie style
>>> from animal import Animal
>>> Animal("dog", "woof").says()
A dog says woofPrint the column headers of a CSV or Excel spreadsheet:
$ python spreadsheet_columns.py people.xlsx
name
age
cityRun python spreadsheet_columns.py -h to see the script's docstring used as the help message, or run python docstring_formats.py to print the same docstring in all four formats.
| Back | FazBrowse Home | New Git URL |