open().read() python 3 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("testfile.txt", "w") as f:
# "w" - write into file
# "r" - read into file
# "+" - read and write into file
f.write("Hello World")