# create a text file for writing with open(r'E:pynative eportsprofit.txt', 'w') as fp: fp.write('This is first line') pass