Skip to content Skip to sidebar Skip to footer

Looping List Of Lists

I am trying to loop through 2 lists and then join them. But I am having trouble structuring the loop code. It's Softimage (Animation 3D program) code, but I hope it makes sense. Th

Solution 1:

I am not sure if it helps you but you can do something like:

members=[["DI_CACHE.lengua","DI_CACHE.vidrios","DI_CACHE.dientes_abajo"],["TOTO_GALLO_cache.lengua","TOTO_GALLO_cache.dientes_01","TOTO_GALLO_cache.plumas_guantes"]]'

and

folders=[["Anim_2p.scn_c_DI_rig"],["Anim_2p.scn_c_TOTO_GALLO_rig"]]

then

for i in xrange(len(a)):
    for n,m in itertools.product(a[i],b[i]):
        print n,m

result:

DI_CACHE.lengua Anim_2p.scn_c_DI_rig
DI_CACHE.vidrios Anim_2p.scn_c_DI_rig
DI_CACHE.dientes_abajo Anim_2p.scn_c_DI_rig
TOTO_GALLO_cache.lengua Anim_2p.scn_c_TOTO_GALLO_rig
TOTO_GALLO_cache.dientes_01 Anim_2p.scn_c_TOTO_GALLO_rig
TOTO_GALLO_cache.plumas_guantes Anim_2p.scn_c_TOTO_GALLO_rig

Post a Comment for "Looping List Of Lists"