line1 = "['a.b.c','b.c.a','c.d.e']"
line2 = "['def','efg']"
line3 = "['f']"
line4 = "['g']"
lines = [line1, line2, line3, line4]
print(eval('+'.join(lines)))
Convert and merge strings into a list in Python