On Thu, Oct 11, 2018 at 8:32 AM kiteh <kiteh.0...@gmail.com> wrote:

> Hi everyone,
>
> I have 2 list items which contains the same amount of items, and I am
> trying to check the order of one list to another.
>
> Eg.
> # This is derived from maya.cmds
> list01 = ['cleve', 'adam', 'yuno', 'pete']
>
> # This is derived from dictionary keys in a way it is capturing the same
> info from the scene but derived very differently
> list02 = ['pete', 'yuno', 'cleve', 'adam']
>
>
> I am unable to use `list01 = list02` or something similar, because both
> lists are called from different applications and hence this question of
> mine.
> And the reason I had wanted to the order to be the same is so that the
> application that uses `list02` will populate in the same hierarchical
> manner as in `list01` (outliner).
>
> And neither would I want to/ can use `sorted` as this will mess up my
> order. What is the best way to go about this?
>
> P.S: Sorry in advance if this sounds like a very noob question...
>

There is no need to apologize for the perceived value of your question.

Can you please expand on your goal? I am confused between the part where
you want to  "check the order of one list to another" vs "unable to use
`list01 = list02`" vs "neither would I want to/ can use `sorted`".

Are you trying to check if list02 is the same order as list01 in terms of
True or False? If you hadn't said list01 and list02 are the same length,
then I would have thought you were trying to iterate list02 sorted by the
order of items in list01. But that doesn't make sense if they both contain
the same items. Testing "==" between the two lists would tell you if they
are sorted the same way or not. Testing sorted(list02) == list01 would tell
you if they contain the same items.

Maybe you can illustrate your expected behaviour with a little more detail?


> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/e248c2b5-26f0-4268-8bf8-73be9a446e99%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/e248c2b5-26f0-4268-8bf8-73be9a446e99%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA20uE8sqDFrTC%2Bg4B6f6c%3D4BZfnZf-KJVAfeMZQw2kMAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to