Cannot write to file
Hi, I'm making a findbyname command, and I want it to automatically ask for a custom password (not a real admin password). I need the password to go to another file, so I used a
with statement to do that. It works find on repl.it, but when I run the code locally, it won't work. Attached is a screenshot of my local code. Any suggestions?
When you're done with a file, always write
f.close() at the bottom. Like this:
f = open("file.txt", "w") f.write("content") f.close
Python will then make a .txt file named file with the word content inside.