❤️ 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))