View Single Post
tomoe
Veteran Member
 
Join Date: Nov 2006
 
2021-05-29, 18:04

❤️ black & flake8 checking. Have both of those setup as pre-commit hooks on my work laptop and as part of the CI/CD.

The logging module can be pretty handy if you want to move beyond print statements, e.g.

Code:
import logging LOGGER = logging.getLogger(__name__) while True: try: # Log variables, return values, etc. LOGGER.info("Some variable in the code is: {my_variable}".format(my_variable=my_variable)) except RuntimeError as err: LOGGER.error("Whoops some error occurred", exc_info=True) LOGGER.info(f"Here is some other variable: {some_other}".format(some_other=some_other))

Seen a man standin' over a dead dog lyin' by the highway in a ditch
He's lookin' down kinda puzzled pokin' that dog with a stick
  quote