The following functions can be used to edit any provided file. In the selected file a string can be searched that can then be replaced with a given string.

Edit a file with python


The following functions can be used to emails from python.

Send mails with python


Send mails with python using AUTH


The output will be captured when the command exited.

Run subprocess


Sourced from - Python Email

Using op.popen and Linux build-in binary free.

Get memory information on Linux


Change Log Format

Adding the following lines to your uvicorn initialization function will change the output of the webserver:

log_config = uvicorn.config.LOGGING_CONFIG
log_config["formatters"]["access"]["fmt"] = "%(asctime)s - %(levelname)s - %(message)s", port=80, host=SERVERIP, log_config=log_config)

Sourced from - tiangolo/fastapi

  • development/python.txt
  • Last modified: 2024/02/27 07:32
  • by Zyzonix