I'm trying to go through a list and print out the list using a secondary list of variables.
The problem is that the variables in the list are getting assigned and set, but are not getting printed out properly. This feels like something really simple but I've been stumped for a day or so on it. Any help would be appreciated!
side = ""
sideLong = ""
sideShort = ""
sideList = ["Right", "Left"]
jointRemapList =[
["Char_Hips", "Root_M"],
["Char_" + sideLong + "Finger1", "IndexFinger1_" + sideShort],
["Char_" + sideLong + "Finger2", "IndexFinger2_" + sideShort]
]
for side in sideList:
sideLong = side
sideShort = side[0]
for jointPair in jointRemapList:
print sideLong, sideShort, jointPair
Expected output would be:
Left L ['Char_Hips', 'Root_M']
Left L ['Char_LeftFinger1', 'IndexFinger1_L']
Left L ['Char_LeftFinger2', 'IndexFinger2_L']
Right R ['Char_Hips', 'Root_M']
Right R ['Char_RightFinger1', 'IndexFinger1_R']
Right R ['Char_RightFinger2', 'IndexFinger2_R']
"foo" + baris not the string "foo" with the suffix of "whatever bar is when we print it",baris evaluated immediately and the string is "foo" + "whatever bar is right now."