随笔分类 -  功能函数

摘要:import pypinyin from pypinyin import Style operator = pypinyin.slug(''.join(infos.get('你好')), separator='') # nihao 阅读全文
posted @ 2021-01-25 16:48 sihte 阅读(89) 评论(0) 推荐(0)
摘要:所需模块 from collections.abc import Iterable 函数 def pingpu(x): def flat_gen(x): def iselement(e): return not (isinstance(e, Iterable) and not isinstance( 阅读全文
posted @ 2020-08-05 17:04 sihte 阅读(123) 评论(0) 推荐(0)
摘要:嵌套的快速迭代 列表与字典的嵌套 列表中包含了多个字典 先用for循环遍历出list其中所有元素(list中的每一个字典都算一个元素),然后对含有字典的元素再利用for key,value in i.items()遍历字典即可 lst = [{'db': 'merchant', 'db_name': 阅读全文
posted @ 2020-07-06 17:54 sihte 阅读(184) 评论(0) 推荐(0)