思路,判断文件大小是否有改变 (绝大多数情况可以)

def is_completed(self, file_path):
        file_size = -1
        while file_size != os.path.getsize(file_path):
            file_size = os.path.getsize(file_path)
            time.sleep(1)

        todo(file_path)

 

posted on 2023-04-11 15:13  lshan  阅读(389)  评论(0)    收藏  举报