conv2mp4-py.py 文件源码

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

项目:conv2mp4-py 作者: BrianDMG 项目源码 文件源码
def garbage_collection():
    global garbage_count, garbage_list
    garbage_count = 0
    garbage_list = ''
    for root, dirs, targets in os.walk(media_path):
        for target_name in targets:
            if target_name.endswith(garbage):
                garbage_count += 1
                fullpath = os.path.normpath(os.path.join(str(root), str(target_name)))
                garbage_list = garbage_list + "\n" + (str(garbage_count) + ': ' + fullpath)
                os.remove(fullpath)
    if garbage_count == 0:
        print ("\nGarbage Collection: There was no garbage found!")
    elif garbage_count == 1:
        print ("\nGarbage Collection: The following file was deleted:")
    else:
        print ("\nGarbage Collection: The following " + str(garbage_count) + " files were deleted:")
    print garbage_list


# Log various session statistics
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号