In python, I'm rehearsing the management of .txt files. I've been finding out about it and found that in the event that I attempt to open a file that doesn't exist yet it will make it to a similar directory, from which the code is executed. The issue comes that when I attempt to open it, I get this error:
IOError: [Errno 2] No such file or directory: 'C:\Users\myusername\PycharmProjects\Tests\copy.txt'.
I also tried by specifying the path,
import os
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
my_file = os.path.join(THIS_FOLDER, 'copy.txt')