python supported file write code example
Example 1: python write to file
with open(filename,"w") as f:
f.write('Hello World')
Example 2: python write to file
with open("test.txt",'w',encoding = 'utf-8') as f:
f.write("my first file\n")
f.write("This file\n\n")
f.write("contains three lines\n")