local_tasks.py 文件源码

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

项目:service-notifications 作者: rehive 项目源码 文件源码
def confirm(prompt='Continue?\n', failure_prompt='User cancelled task'):
    '''
    Prompt the user to continue. Repeat on unknown response. Raise
    ParseError on negative response
    '''
    response = input(prompt)

    try:
        response_bool = strtobool(response)
    except ValueError:
        print('Unkown Response. Confirm with y, yes, t, true, on or 1; cancel with n, no, f, false, off or 0.')
        confirm(prompt, failure_prompt)

    if not response_bool:
        raise ParseError(failure_prompt)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号