I can write to a file in current directory. I cannot write to a file in a subdirectory. I checked online but the posts and previous questions didn't really help. I have the code below, it should write to File.txt which is inside Subfolder. However, instead of this, I get a new File called "SubFolder\File.txt" in my current directory.
Any help?
PATH = os.getcwd()
PATH+= 'SubFolder\File.txt'
fileInput = open(PATH, "w")
fileOutput = open("SubFolder\File.txt", "w")
I expect a file in a subfolder. I get a file with the desired path as a file name. Can you help? Thanks!