这是我的代码,类似于此处给出的示例(Pypxlib on Github)
from pypxlib import Table
table = Table(file)
try:
for row in table:
print(row['Ident'])
finally:
table.close()
对于大约一半的表,它正确地读取了字段,但是另一半它给了我一些奇怪的输出。
~RackC\SGr2\Cmp2\SLA
~RackC\SGr2\Cmp2\Run
~RackC\SGr2\Cmp2\UNL1
~RackC\SGr2\Cmp2\Cycles
Subcool Outlet Temp Rack B
Subcool Outlet Temp Rack A
B03 Fans Rack View
(Name for below) ~EEPR #1 Rack B\Percent Open Valve 3
[~TF:RefrigLib\TSilData_Refrig_Lib~][~P:3~]~EEPR #1 Rack B\[~strHistRefrigLib_cstPercentOpenVlv~]
Subcool Outlet Temp Rack D
D02 Fans Rack View
(Name for below) ~EEPR #1 Rack D\Percent Open Valve 3
[~TF:RefrigLib\TSilData_Refrig_Lib~][~P:3~]~EEPR #1 Rack D\[~strHistRefrigLib_cstPercentOpenVlv~]
Warm Fluid Temp
Warm Fluid 3 Way Valve %
(Name for below) ~EEPR #1 Rack A\Effect SetPt Valve 1
[~TF:RefrigLib\TSilData_Refrig_Lib~][~P:1~]~EEPR #1 Rack A\[~strHistRefrigLib_cstEffectSetPtVlv~]
任何人都知道为什么它可以像这样解析字符串?我试图解析不受我控制的数据,因此我无法更改任何字符串的名称。