example1.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:python-cookbook-3rd 作者: tuanavu 项目源码 文件源码
def main():
    # Configure the logging system
    logging.basicConfig(
        filename='app.log',
        level=logging.ERROR
    )

    # Variables (to make the calls that follow work)
    hostname = 'www.python.org'
    item = 'spam'
    filename = 'data.csv'
    mode = 'r'

    # Example logging calls (insert into your program)
    logging.critical('Host %s unknown', hostname)
    logging.error("Couldn't find %r", item)
    logging.warning('Feature is deprecated')
    logging.info('Opening file %r, mode=%r', filename, mode)
    logging.debug('Got here')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号