我的UML图是这样的:
rootNode
|
Book (attribute:name)
|
Table (attribute: Name)
|
TableEntry(attribute: Field, Value)
当我使用此代码时:
for Book in rootNode.getBooks():
print Book.getName()
for Table in Book.getTables():
print Table.getName()
for TableEntry in Table.getTableEntrys():
print TableEntry.getField(), TableEntry.getValue()
输出如下:
Document
T1
F1 V1
F2 V2
F3 V3
F4 V4
F5 V5
F6 V6
T2
F1 V1
F2 V2
F3 V3
F4 V4
F5 V5
F6 V6
Document
T2
F2 V2
F3 V3
F4 V4
F5 V5
F6 V6
我想比较每个字段和值的字段和值ex-F1和文档中的值V1(第一个)和文档中的F1 V1(第二个)。 我有相同的书名为'文件'。 我还想在这两个文件中找到丢失的字段或附加字段,比如在T2中,我的F1和V1丢失了。你知道吗
最好的解决方案是“==”来比较这些值
如果要与实体进行比较,请使用“is”
例如=>
a=123; b=123
输出:
是的
相关问题 更多 >
编程相关推荐