macpie.lltools.move_item_to#

macpie.lltools.move_item_to(l, item, item_to_move_to, offset=0)#

Move an item in a list to the just before the position of another item.

>>> lst = ['c', 'a', 'b', 'd', 'e']
>>> move_item_to(lst, 'c', 'd')
>>> lst
['a', 'b', 'c', 'd', 'e']
Parameters:
  • a – list

  • item – list item to move

  • item_to_move_toitem will be moved to the position just before this item