data_Utils.py 文件源码

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

项目:warriorframework 作者: warriorframework 项目源码 文件源码
def generate_datafile(lists_of_systems, output_dir, filename):
    """
        take in a list of lists which contains systems
        generate one input data file per list
    """
    result = []
    for index, list_of_sys in enumerate(lists_of_systems):
        output_filename = filename + "_" + str(index) + ".xml"
        output_file = os.path.join(output_dir, output_filename)
        fd = file_Utils.open_file(output_file, "w+")
        if fd is not None:
            root = xml_Utils.create_element("root")
            for system in list_of_sys:
                root.append(system)
            fd.write(xml_Utils.convert_element_to_string(root))
            result.append(output_file)
    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号