我认为这是SOAP的输出,是否可以从此处获取特定值,我已经尝试将其附加到列表中,但它无法正常工作。我得到的输出是这样的:
self.usbFilePaths = []
self.newUsbFilePaths = []
for i in self.usbFilePaths:
os.path.join(self.usbFolder, self.hostTestFiles[i])
for i in self.newUsbFilePaths:
os.path.join(self.usbFolder, self.usbTestFiles[i])
def copyToUsb (self):
print "Copying file from comp to usb"
for item in self.hostFilePaths:
shutil.copy(item, self.usbFolder)
time.sleep(4)
for i in range(0,10):
print "here 2"
shutil.move(self.usbFilePaths[i], self.newUsbFilePaths[i])
time.sleep(4)
我不确定这是XML,dict还是什么,我尝试了这个脚本“print type(results)”,输出是:“type'instance'”
我只需要在输出中获取特定值,其他将被忽略,就像拆分方法或在列表中查找值一样,
(reply){
QueryResult =
(QueryResult){
NewDataSet =
(NewDataSet){
schema =
(schema){
_id = "NewDataSet"
element =
(element){
_IsDataSet = "true"
_UseCurrentLocale = "true"
_name = "NewDataSet"
complexType =
(complexType){
choice =
(choice){
_maxOccurs = "unbounded"
_minOccurs = "0"
element =
(element){
_name = "Table"
complexType =
(complexType){
sequence =
(sequence){
element[] =
(element){
_type = "xs:string"
_name = "Holder"
_minOccurs = "0"
},
(element){
_type = "xs:string"
_name = "Job"
_minOccurs = "0"
},
(element){
_type = "xs:int"
_name = "SliderCount"
_minOccurs = "0"
},
(element){
_type = "xs:int"
_name = "RowCount"
_minOccurs = "0"
},
}
}
}
}
}
}
}
Table =
(Table){
ResultA = "Dora"
ResultB = "The Explorer"
ResultC= "123-321"
}
}
}
HasMoreRows = False
}
提前感谢任何建议/意见