我试图阅读一个由商业软件生成的YAML文件。test.yml
的摘录如下:
%YAML 1.1
---
VesselTypes:
- Name: Tanker
Length: 103
Draughts:
- Name: Draught1
Mass: 9017.95
MomentOfInertiaTensorX, MomentOfInertiaTensorY, MomentOfInertiaTensorZ:
- [254.9374465E3, 1, 2]
- [3, 5.979802645E6, 4]
- [7, 8, 5.979802645E6]
- [9, 10, 11]
然后,在使用python解析该文件时:
^{pr2}$关于如何解析数据有什么建议吗?我刚开始学习YAML格式,和python都有,所以有点困惑。在
使用列表解包在不使用循环的情况下提取列表。在
相关问题 更多 >
编程相关推荐