Python

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

Show/Hide

The following functions can be used to emails from python.

Send mails with python

Show/Hide

Send mails with python using AUTH

Show/Hide

The output will be captured when the command exited.

Run subprocess

Show/Hide

Sourced from stackoverflow.com - Python Email

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

Get memory information on Linux

Show/Hide

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"
uvicorn.run(app, port=80, host=SERVERIP, log_config=log_config)

Sourced from github.com - tiangolo/fastapi

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