INFILE = "input.csv"
OUTFILE = "my.txt"
def row_sum(row, delim=","):
try:
return sum(int(i) for i in row.split(delim))
except ValueError:
return ""
with open(INFILE) as inf, open(OUTFILE, "w") as outf:
outf.write("\n".join(str(row_sum(row)) for row in inf))