app.py 文件源码

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

项目:blog-code-examples 作者: fullstackpython 项目源码 文件源码
def show_message(msg):
    """Display a message if the msg value is greater than 2 characters
    in the path.
    """
    valid_length = len(msg) >= MIN_MSG_LENGTH
    valid_name = re.match('^[a-z\-]+$', msg.lower()) is not None
    if valid_length and valid_name:
        return template(TEMPLATE_STRING, h1=msg)
    else:
        error_msg = "Sorry, only alpha characters and hyphens allowed."
        raise Exception(error_msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号