0
下面的差異元組的兩個列表:如何獲取列表
text1_lines = [('a','1'), ('b', '2'), ('c','3')]
text2_lines = [('a','4'), ('z', '5'), ('c','6')]
我可以得到的差異下面的代碼
d = difflib.Differ()
diff = d.compare(text1_lines,text2_lines)
diff_list = '\n'.join(diff)
請建議我如何轉換diff_list
成列表,以便我可以遍歷列表。
...刪除'join'? – melpomene