python in jsonpath, nnlog, send e-mail

import jsonpath,requests,nnlog,yagmail

 

1.jsonpath usage

print (jsonpath.jsonpath (res, '$ .. sign')) # dictionary to quickly locate target target key, the outcome is returned, no return False

 

2.nnlog

log = nnlog.Logger('book_server.log',backCount=5,level='debug')

# Parameter 1 for the log path, if you do not pass is created in the current directory, parameter 2 to keep the last five days of data, parameter 3 for the log level
# In fact, the purpose of printing with print is the same, but if the project is deployed to after the server with a print can not see, can only be saved with the log to print out a document to view it

log.debug(res)
log.info(res)
log.warning(res)
log.error(res)

 

3.yagmail send a message

 

Guess you like

Origin www.cnblogs.com/wangyujian/p/11804769.html