mk wrote:
Hello everyone,

I have two lists of IP addresses:

hostips = [ 'a', 'b', 'c', 'd', 'e' ]

thread_results = [ 'd', 'b', 'c' ]

I need to sort thread_results in the same order as hostips.

P.S. One clarification: those lists are actually more complicated (thread_result is a list of tuples (ip, thread)), which is why I need thread_results sorted in order of hostips (instead of just constructing [ h for h in hostips if h in thread_results ] and be done with it).




--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to