python 比较两个yaml文件

 

import yaml

with open("a.yaml") as f:
    with open("a.yaml") as k:
        while(1):
            x=f.readline()
            if(x):
                if(x==k.readline()):
                    pass
                else:
                    print("not equal")
            else:
                print("end!")
                break
 

 

posted @ 2019-02-11 19:39  anobscureretreat  阅读(1046)  评论(2编辑  收藏  举报