apply_mask.py 文件源码

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

项目:masks-and-hats 作者: leoneckert 项目源码 文件源码
def assert_dir(dir_path):
    potential_out_dir = dir_path
    idx = -1
    while os.path.isdir(potential_out_dir):
        idx += 1
        if idx == 0:
            potential_out_dir += "_0"
            continue
        potential_out_dir = "_".join( potential_out_dir.split("_")[:-1] ) +  "_" + str(idx)  
    out_dir = potential_out_dir
    os.mkdir(out_dir)
    print "[+] Created " + out_dir + ". and will save output to that directory" 
    return out_dir
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号