You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
383 B
13 lines
383 B
# logging
|
|
import logging
|
|
logging.basicConfig(filename="app.log", format="%(asctime)s:%(levelname)s:%(funcName)s:%(message)s")
|
|
logging.error("failed to connect")
|
|
|
|
# ip address validation
|
|
import ipaddress
|
|
ipaddress.ip_address("${ip}")
|
|
|
|
# print python dictionary in yaml
|
|
import yaml # requires package `pyyaml`
|
|
print(yaml.dump(dictionary, sort_keys=False)) # `sort_keys` is optional
|
|
|
|
|