ZBLOG

- Id: "102" FileRe: ".*" SecondMethod: "re_ver_collect" SecondValue: "([A-Za-z0-9]{32})" Desc: "Tencent Secret Key" Flag: "tencent-secret-key" ModifyAt: "" - Id: "

由于没有指定编程语言,以下提供Python的代码示例:

import yaml

with open('file.yaml', 'r') as file:
    config = yaml.safe_load(file)

for item in config:
    print(item['Id'])
    print(item['FileRe'])
    print(item['SecondMethod'])
    print(item['SecondValue'])
    print(item['Desc'])
    print(item['Flag'])
    print(item['ModifyAt'])

其中,file.yaml是待读取的yaml文件路径。读取后对每一个字典元素循环打印各个字段的值。

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=68

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?