一种方法是使用
itertools.islice
>>> gen = (x for x in range(10))>>> index = 5>>> next(itertools.islice(gen, index, None))5
上一篇 适用于Python的Amazon API库吗?[关闭]
下一篇 装饰器执行顺序
版权所有 (c)2021-2022 MSHXW.COM
ICP备案号:晋ICP备2021003244-6号