我有一个如下的文本文件:(块之间用一条空行分隔)
#*Approximate Distance Oracles with Improved Query Time.
#@Christian Wulff-Nilsen
#t2015
#cEncyclopedia of Algorithms
#index555036b37cea80f954149ffc
#*Subset Sum Algorithm for Bin Packing.
#@Julián Mestre
#t2015
#cEncyclopedia of Algorithms
#index555036b37cea80f954149ffd
我想解析每个块并将结果存储到一个名为Document的对象中
提前谢谢
您可以尝试使用python TTP库在字典列表中对其进行转换:
要创建对象,需要使用类并为类属性指定字典值。然而,如果目标是处理数据,字典列表应该足够好了
相关问题 更多 >
编程相关推荐