Convert Tab-Delimited to CSV

This is a very simple exercise, but necessary at times in Data Science.

f = open("input_data.txt") # input file tab delimited
output=open("output_data.csv","a")
f.readline() # skip the first line if needed for header removal
for line in f:
mystring = line.replace("\t", ",")
output.write(mystring)
print('file created successfully')
f.close()
output.close()