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 @ 2024-01-29 20:25  大白熊^_^  阅读(14)  评论(0编辑  收藏  举报