How can I use python to create and write to a text file in python, and also how would I be able to save this text file to my computer? I want this text file to accessible just by using Python, and everything in that text file to be accessible in the console.
I also want this file to be saved in the Documents directory.
The issue is that no output is given nor has any text file been created in the same destination.
This is the code I ran:
myfile = open("newfile.txt", "w")
myfile.write("This is text from newfile")
myfile.close()