I have the following list :
all_lines [[(0, 0), (0, 7)],
[(20, 20), (0, 7)],
[(0, 0), (13, 20)],
[(20, 20), (13, 20)],
[(10, 0), (0, 17), (10, 10), (10, 17), (20, 0), (20, 17), (0, 20), (20, 7)]]
So I would like to convert it to the following format:
all_lines [[(0, 0), (0, 7)],
[(20, 20), (0, 7)],
[(0, 0), (13, 20)],
[(20, 20), (13, 20)],
[(10, 0), (0, 17)],
[(10, 10), (10, 17)],
[(20, 0), (20, 17)],
[(0, 20), (20, 7)]]
I tried :
flat_list = [item for sublist in all_lines for item in sublist]
but did not give me desired format.
How can I convert the list into my desired format?