摘要: 1.python脚本性能分析 cProfile思路 使用cProfile模块生成脚本执行的统计信息文件 使用pstats格式化统计信息,并根据需要做排序分析处理 使用snakeviz图形化页面显示 2.cProfile 使用cProfile模块生成脚本执行的统计信息文件 1.使用cProfile模块 阅读全文
posted @ 2023-01-03 15:53 lxd670 阅读(277) 评论(0) 推荐(0)
摘要: 可迭代对象 可以被for循环的对象 判断是否是可迭代对象 from collections.abc import Iterable my_str = 'abcd' isinstance(my_str, Iterable) # True 迭代器 迭代器是一个可以记住遍历位置的对象,迭代器从第一个元素开 阅读全文
posted @ 2023-01-03 10:53 lxd670 阅读(36) 评论(0) 推荐(0)