pyArchiveStruct.py 文件源码

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

项目:Parallel.GAMIT 作者: demiangomez 项目源码 文件源码
def scan_archive_struct_stninfo(self,rootdir):

        # same as scan archive struct but looks for station info files
        self.archiveroot = rootdir

        stninfo = []
        path2stninfo = []
        for path, dirs, files in scandir.walk(rootdir):
            for file in files:
                if file.endswith(".info"):
                    # only add valid rinex compressed files
                    stninfo.append(os.path.join(path,file).rsplit(rootdir+'/')[1])
                    path2stninfo.append(os.path.join(path,file))
                else:
                    if file.endswith('DS_Store') or file[0:2] == '._':
                        # delete the stupid mac files
                        try:
                            os.remove(os.path.join(path, file))
                        except:
                            sys.exc_clear()

        return stninfo,path2stninfo
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号