python获取一组汉字拼音首字母的方法

banban66473 13 0 PDF 2020-12-29 22:12:41

本文实例讲述了python获取一组汉字拼音首字母的方法。分享给大家供大家参考。具体实现方法如下: #!/usr/bin/env python # -*- coding: utf-8 -*- def multi_get_letter(str_input): if isinstance(str_input, unicode): unicode_str = str_input else: try: unicode_str = str_input.decode('utf8') except: try: unicode_str =

用户评论
请输入评论内容
评分:
暂无评论