"leodp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Or provide a better explanation and an example. Do you mean something
like
this?
Hi Peter,
a small example:
master=[1,4,3,2]
slave1=['d','c','b','a']
slave2=[1,2,3,4]
master.sort() # this is ok, but does not return infos on how the list
was sorted
slave1.sort(key=_maybe_something_here_referring_to_master_)
slave2.sort(key=_maybe_something_here_referring_to_master_)
Then I should get:
master=[1,2,3,4]
slave1=['d','a','b','c']
slave2=[1,4,3,2]
Hope it is more clear now.
Thanks, leodp
How about:
master=[1,4,3,2]
slave1='d c b a'.split()
slave2=[1,2,3,4]
x=zip(master,slave1,slave2)
x.sort()
master,slave1,slave2=zip(*x)
master
(1, 2, 3, 4)
slave1
('d', 'a', 'b', 'c')
slave2
(1, 4, 3, 2)
--Mark
--
http://mail.python.org/mailman/listinfo/python-list