Python TypeError:对象不支持项分配
我有以下关于vb api的类定义。我需要在python脚本中使用它Python TypeError:对象不支持项分配,python,Python,我有以下关于vb api的类定义。我需要在python脚本中使用它 Public Property HideFilter( _ ByVal FilterType As String _ ) As String 我在python scrip中尝试了以下代码,但它不起作用。有什么帮助吗 CustUserGroup是类的对象 setattr(CustUserGroup.HideFilter, "FilterType ", "Req") setattr(CustUserGroup ,"Hi
Public Property HideFilter( _
ByVal FilterType As String _
) As String
我在python scrip中尝试了以下代码,但它不起作用。有什么帮助吗
CustUserGroup是类的对象
setattr(CustUserGroup.HideFilter, "FilterType ", "Req")
setattr(CustUserGroup ,"HideFilter", "FilterText")
错误:AttributeError:“instancemethod”对象没有属性“FilterType”
CustUserGroup.HideFilter["Req"] = rfilter.Text
TypeError:object不支持项目分配您确实不清楚您正试图做什么-但粗略猜测,您可能想要类似的东西
CustUserGroup.HideFilter = "Req" # set property value
res = CustUserGroup.HideFilter # get property value