Documenting your next Python Project:
Right the Docs
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
We will be taking a project by project tour on
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
```
Commenting Code via Type Hinting (Python 3.5+)
Type hinting was added to Python 3.5 and is an additional form
to help the readers of your code. Here’s a quick example:
````
def hello_name(name: str) -> str:
return(f"Hello {name}")
class SimpleClass:
"""Class docstrings go here."""
def say_hello(self, name: str):
"""Class method docstrings go here."""
print(f'Hello {name}')
Examples taken from Real Python's Python Documentation blog
@vipulgupta2048
def get_spreadsheet_cols(file_loc, print_cols=False):
"""Gets and prints the spreadsheet's header columns
Parameters
----------
file_loc : str
The file location of the spreadsheet
print_cols : bool, optional
A flag used to print the columns to the console (default is
False)
Returns
-------
list
a list of strings used that are the header columns
"""
file_data = pd.read_excel(file_loc)
col_headers = list(file_data.columns.values)
if print_cols:
print("\n".join(col_headers))
return col_headers
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
Django Project's Overview Page
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
@vipulgupta2048
Questions? Get in touch.
Mixster offers first consultation free on your docs, if things work out first round of ice-creams are on us!
Vipul Gupta
Part-time remote setup builder, writes half-decent blogs and makes memes that no one asked for.