load.py 文件源码

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

项目:operative-framework 作者: graniet 项目源码 文件源码
def export_data_search_db(export, export_file, export_status, title):
    if len(export) > 0:
        if export_file == "":
        user_input = raw_input("operative (export file name ?) > ")
        if os.path.exists("export/"+user_input):
            export_file = "export/"+user_input
        elif os.path.exists(user_input):
            export_file = user_input
        else:
            print Fore.GREEN + "Writing " + user_input + " file" + Style.RESET_ALL
        export_file = "export/"+user_input
        export_data(export, export_file, export_status, title)
    elif export_status == False:
        file_open = open(export_file,"a+")
        file_open.write(title)
        for line in export:
            file_open.write("- " + line +"\n")
        print Fore.GREEN + "File writed : " + export_file + Style.RESET_ALL
        file_open.close()
        export_status = True
    else:
        print Back.YELLOW + Fore.BLACK + "Module empty result" + Style.RESET_ALL
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号