Code has been added to clipboard!

Printing to a File in Python

Example
fl = open('file.txt', 'w')
print('This text will be written in the file', file = fl)
fl.close()