python 调用 win32com 播放 语句

import re
import win32com.client

speaker = win32com.client.Dispatch("SAPI.SpVoice")
tests =['12321abcdef','23a2b','a-b-c','12','aAbc34','adf33']
pattern='^[a-z0-9]{3,16}$'
for test in tests:
    if re.match(pattern, test):
        print('"{0}"符合正则表达式'.format(test))

    else:
        print('"{0}"不符合正则表达式'.format(test))
        speaker.Speak('您好,不符合正则表达式')
posted @   大白熊^_^  阅读(50)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 25岁的心里话
历史上的今天:
2021-01-29 23txt小说网去广告
点击右上角即可分享
微信分享提示