Suds reply python SyntaxError: invalid syntax
Suds reply python SyntaxError: invalid syntax
我有一个泡沫回复。我正在使用 result = Client.dict(results) 将其格式化为 dict 对象。当我尝试访问部分结果时 (parts = result['Product']['ProductPartArray']['ProductPart']) 它一直在内部控制台上给我一个语法错误。我不知道为什么会这样或如何解决它。代码运行良好并为我提供了我需要的结果,但它把我带到了一个内部控制台并出现语法错误。有帮助吗?
Thanks
(reply){
Product =
(Product){
productId = "12"
productName = "Pull-A-Part Key Tag"
description[] =
"<ul><li>Printed Paper Inserts Are A Great Way To Customize At A Low Cost</li><li>Includes One Color Imprint On White Paper Background</li></ul>",
ProductMarketingPointArray =
(ProductMarketingPointArray){
ProductMarketingPoint[] =
(ProductMarketingPoint){
pointType = "Highlight"
pointCopy = "Printed Paper Inserts Are A Great Way To Customize At A Low Cost"
},
(ProductMarketingPoint){
pointType = "Highlight"
pointCopy = "Includes One Color Imprint On White Paper Background"
},
}
export = True
ProductCategoryArray =
(ProductCategoryArray){
ProductCategory[] =
(ProductCategory){
category = "Tools, Lights & Key Tags"
subCategory = "Metal - Bottle Opener / Key Tags"
},
}
ProductPartArray =
(ProductPartArray){
ProductPart[] =
(ProductPart){
partId = "0012SIL"
ColorArray =
(ColorArray){
Color[] =
(Color){
colorName = "SILVER"
},
}
Dimension =
(Dimension){
dimensionUom = "MM"
depth = 0.0
height = 3.5
width = 0.5
weightUom = "LB"
weight = 0.036
}
isRushService = True
ShippingPackageArray =
(ShippingPackageArray){
ShippingPackage[] =
(ShippingPackage){
packageType = "Box"
description = "EE"
quantity = 500.0
dimensionUom = "IN"
depth = 13.0
height = 11.0
width = 13.0
weightUom = "LB"
weight = 24.0
},
(ShippingPackage){
packageType = "Box"
description = "E0"
quantity = 1000.0
dimensionUom = "IN"
depth = 16.0
height = 12.0
width = 15.0
weightUom = "LB"
weight = 47.0
},
(ShippingPackage){
packageType = "Box"
description = "FA"
quantity = 250.0
dimensionUom = "IN"
depth = 10.0
height = 6.0
width = 7.0
weightUom = "LB"
weight = 9.0
},
}
endDate = 2016-01-31 00:00:00
effectiveDate = 2016-01-01 00:00:00
isCloseout = False
isCaution = False
isOnDemand = False
isHazmat = False
},
}
lastChangeDate = 2016-01-01 00:00:00
creationDate = 2016-01-01 00:00:00
endDate = 2016-01-31 00:00:00
effectiveDate = 2016-01-01 00:00:00
isCaution = False
isCloseout = False
lineName = "HIT"
}
}
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "C:\Users\Justin Sumey\Anaconda2\lib\site-packages\qtconsole\base_frontend_mixin.py", line 163, in _dispatch
handler(msg)
File "C:\Users\Justin Sumey\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole\namespacebrowser.py", line 189, in _handle_execute_reply
self.handle_exec_method(msg)
File "C:\Users\Justin Sumey\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole\shell.py", line 244, in handle_exec_method
view = ast.literal_eval(data['text/plain'])
File "C:\Users\Justin Sumey\Anaconda2\lib\ast.py", line 49, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "C:\Users\Justin Sumey\Anaconda2\lib\ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 25
'view': Pull-A-Part Key Tag},
^
SyntaxError:
invalid syntax
product_name = str(result['Product']['productName']) 我必须将 str 函数添加到 name 属性。
我有一个泡沫回复。我正在使用 result = Client.dict(results) 将其格式化为 dict 对象。当我尝试访问部分结果时 (parts = result['Product']['ProductPartArray']['ProductPart']) 它一直在内部控制台上给我一个语法错误。我不知道为什么会这样或如何解决它。代码运行良好并为我提供了我需要的结果,但它把我带到了一个内部控制台并出现语法错误。有帮助吗?
Thanks
(reply){
Product =
(Product){
productId = "12"
productName = "Pull-A-Part Key Tag"
description[] =
"<ul><li>Printed Paper Inserts Are A Great Way To Customize At A Low Cost</li><li>Includes One Color Imprint On White Paper Background</li></ul>",
ProductMarketingPointArray =
(ProductMarketingPointArray){
ProductMarketingPoint[] =
(ProductMarketingPoint){
pointType = "Highlight"
pointCopy = "Printed Paper Inserts Are A Great Way To Customize At A Low Cost"
},
(ProductMarketingPoint){
pointType = "Highlight"
pointCopy = "Includes One Color Imprint On White Paper Background"
},
}
export = True
ProductCategoryArray =
(ProductCategoryArray){
ProductCategory[] =
(ProductCategory){
category = "Tools, Lights & Key Tags"
subCategory = "Metal - Bottle Opener / Key Tags"
},
}
ProductPartArray =
(ProductPartArray){
ProductPart[] =
(ProductPart){
partId = "0012SIL"
ColorArray =
(ColorArray){
Color[] =
(Color){
colorName = "SILVER"
},
}
Dimension =
(Dimension){
dimensionUom = "MM"
depth = 0.0
height = 3.5
width = 0.5
weightUom = "LB"
weight = 0.036
}
isRushService = True
ShippingPackageArray =
(ShippingPackageArray){
ShippingPackage[] =
(ShippingPackage){
packageType = "Box"
description = "EE"
quantity = 500.0
dimensionUom = "IN"
depth = 13.0
height = 11.0
width = 13.0
weightUom = "LB"
weight = 24.0
},
(ShippingPackage){
packageType = "Box"
description = "E0"
quantity = 1000.0
dimensionUom = "IN"
depth = 16.0
height = 12.0
width = 15.0
weightUom = "LB"
weight = 47.0
},
(ShippingPackage){
packageType = "Box"
description = "FA"
quantity = 250.0
dimensionUom = "IN"
depth = 10.0
height = 6.0
width = 7.0
weightUom = "LB"
weight = 9.0
},
}
endDate = 2016-01-31 00:00:00
effectiveDate = 2016-01-01 00:00:00
isCloseout = False
isCaution = False
isOnDemand = False
isHazmat = False
},
}
lastChangeDate = 2016-01-01 00:00:00
creationDate = 2016-01-01 00:00:00
endDate = 2016-01-31 00:00:00
effectiveDate = 2016-01-01 00:00:00
isCaution = False
isCloseout = False
lineName = "HIT"
}
}
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "C:\Users\Justin Sumey\Anaconda2\lib\site-packages\qtconsole\base_frontend_mixin.py", line 163, in _dispatch
handler(msg)
File "C:\Users\Justin Sumey\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole\namespacebrowser.py", line 189, in _handle_execute_reply
self.handle_exec_method(msg)
File "C:\Users\Justin Sumey\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole\shell.py", line 244, in handle_exec_method
view = ast.literal_eval(data['text/plain'])
File "C:\Users\Justin Sumey\Anaconda2\lib\ast.py", line 49, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "C:\Users\Justin Sumey\Anaconda2\lib\ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 25
'view': Pull-A-Part Key Tag},
^
SyntaxError:
invalid syntax
product_name = str(result['Product']['productName']) 我必须将 str 函数添加到 name 属性。