随笔分类 - 功能函数
摘要:import pypinyin from pypinyin import Style operator = pypinyin.slug(''.join(infos.get('你好')), separator='') # nihao
阅读全文
摘要:所需模块 from collections.abc import Iterable 函数 def pingpu(x): def flat_gen(x): def iselement(e): return not (isinstance(e, Iterable) and not isinstance(
阅读全文
摘要:嵌套的快速迭代 列表与字典的嵌套 列表中包含了多个字典 先用for循环遍历出list其中所有元素(list中的每一个字典都算一个元素),然后对含有字典的元素再利用for key,value in i.items()遍历字典即可 lst = [{'db': 'merchant', 'db_name':
阅读全文

浙公网安备 33010602011771号