If we need to write a new line to a file we have to code:
file_output.write('Fooo line \n')
Are there any reasons why Python does not have a writeln()
method?
In Python 2, use:
print >>file_output, 'Fooo line '
In Python 3, use:
print('Fooo line ', file=file_output)