I’ve just started using Atom on Mac for my computing projects written in Python. I installed the “atom-python-run” package to easily run my programs in the terminal.
It mostly works fine however I don’t seem to be able to save or read from txt files. When using the code below through Atom it either doesn’t write to the file or prints blank lines when reading. I tried the same code in IDLE and it works perfectly fine so I believe it a problem with Atoms permissions not being able to access files? Any idea where I could fix this?
The other problem related to this is that if I try to run a Python file that’s in a folder and not on the desktop, I get an error saying the file doesn’t exist. It seems like Atom doesn’t have the correct permissions but as I’m knew to Mac I’m unsure how to fix it. Any ideas?
string = "Lots of words" f = open("textfile.txt", "w") f.write(string) f.close()