sum numbers in lines python : This is what I have to do:

1. Read content of a text file, where two numbers separated by comma are on each line (like 10, 5\n, 12, 8\n, …)

2. Make a sum of those two numbers

3. Write into new text file two original numbers and the result of summation = like 10 + 5 = 15\n, 12 + 8 = 20\n, …

so far I have this:

        import os
    import sys
    
    relative_path = "Homework 2.txt"
    if not os.path.exists(relative_path):
        print "not found"
        sys.exit()
    
    read_file = open(relative_path, "r")
    lines = read_file.readlines()
    read_file.close()
    print lines
    
    path_output = "data_result4.txt"
    write_file = open(path_output, "w")
    
    for line in lines:
        line_array = line.split()
        print line_array



