adsbib.py 文件源码

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

项目:atoolbox 作者: liweitianux 项目源码 文件源码
def _build(inputs):
        paths = []
        for f in inputs:
            if os.path.isdir(f):
                # Walk through the directory and get all PDF files
                # Credit: https://stackoverflow.com/a/2186565/4856091
                for root, dirnames, filenames in os.walk(f):
                    for filename in fnmatch.filter(filenames, "*.pdf"):
                        paths.append(os.path.join(root, filename))
            elif f.endswith(".pdf"):
                paths.append(f)
            else:
                # Get the contents as list of files
                _files = [line.strip() for line in open(f).readlines()]
                _files = [_f for _f in _files
                          if (not _f.startswith("#")) and (_f != "")]
                paths += _files
        return paths
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号