main.py 文件源码

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

项目:betaPika 作者: alchemistake 项目源码 文件源码
def delete_identical_files():
    for battle_folder in os.listdir(download_path):
        battle_folder_path = os.path.join(os.curdir, download_folder_name, battle_folder)

        if not battle_folder.startswith('.') and os.path.isdir(battle_folder_path):
            battle_files = os.listdir(battle_folder_path)

            previous_battle_file = os.path.join(os.curdir, "main.py")
            for battle_file in battle_files:
                current_battle_file = os.path.join(os.curdir, download_folder_name, battle_folder, battle_file)
                if filecmp.cmp(previous_battle_file, current_battle_file, shallow=0):
                    os.remove(current_battle_file)
                    print current_battle_file, "Deleted, copy of another file"
                else:
                    previous_battle_file = current_battle_file
    print "Identical file search complete."
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号