whatstyle.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:whatstyle 作者: mikr 项目源码 文件源码
def grouper(n, iterable, padvalue=None):
    # type: (int, Iterable[Any], Any) -> Iterable[Iterable[Any]]
    """grouper(3, 'abcdefg', 'x') --> ('a','b','c'), ('d','e','f'), ('g','x','x')"""
    return izip_longest(*[iter(iterable)] * n, fillvalue=padvalue)

# ----------------------------------------------------------------------
# Functions to find an executable in the PATH, from:
# http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号