次に、重複を削除しようとすると、TypeError が発生します...なぜですか?
一時リスト=リスト(セット(一時リスト))
Error: TypeError: file line 29: 'str' object is not callable #
これは実際のコードです:
# Lists all UI elements
allUI=pm.lsUI()[24:28]
#Main Window Name
win='searchElementsUI'
#Lists for UI Hierachy
allSplitUI=[]
maxLenUI=[]
parentDict={}
#Splits UI Elements
for ui in allUI:
allSplitUI.append(ui.split('|'))
#Max length of UISplit
for ui in allSplitUI:
maxLenUI.append(len(ui))
maxLenUI=max(maxLenUI)
#Adds main Parents to list
tempList=[]
for i in range(maxLenUI):
tempList=[]
for ui in allSplitUI:
try:
tempList.append(ui[i])
except:pass
tempList=list(set(tempList))
parentDict['list%s'%i]=tempList
Maya からの完全なトレースバックは次のとおりです。
# Lists all UI elements
allUI=pm.lsUI()
#Main Window Name
win='searchElementsUI'
#Lists for UI Hierachy
allSplitUI=[]
maxLenUI=[]
parentDict={}
#Splits UI Elements
for ui in allUI:
allSplitUI.append(ui.split('|'))
#Max length of UISplit
for ui in allSplitUI:
maxLenUI.append(len(ui))
maxLenUI=max(maxLenUI)
#Adds main Parents to list
tempList=[]
for i in range(maxLenUI):
tempList=[]
for ui in allSplitUI:
try:
tempList.append(ui[i])
except:pass
tempList=list(set(tempList))
parentDict['list%s'%i]=tempList
# Error: 'str' object is not callable
# Traceback (most recent call last):
# File "<maya console>", line 29, in <module>
# TypeError: 'str' object is not callable #