Category : tuples

I have the following variable: data = [([‘a’, ‘b’, ‘3’], [‘c’, ‘a’, ‘r’]), ([‘*’, ‘[‘, ‘e’], [’33’, ‘gh’, ‘ew’]), ([’23^’, ‘re#’, ‘4$’], [‘tr’, ‘fF’, ‘5%’])] I want to write data into a CSV file as follows: a c b a 3 r * 33 [ gh e ew 23^ tr re# fF 4$ 5% Note ..

Read more

I want to sort a list of tuple for a user defined condition within the list. Below is my list of tuples. new_list = [(‘eth2’, ‘2001:0db8:::8a2e:0370:7334’), (‘new-MGMT’, ‘10.10.0.1’), (‘management’, ‘20.20.0.2’), (‘eth2.1’, ‘20.20.3.1’), (‘eth2.2’, ‘30.30.3.1’)] My condition to sort is: The interface name which contains MGMT or management needs to be moved to the begining of ..

Read more