Debugging turned out not to be a problem. The file was running in a folder above its own folder so using a relative file location fixed the problem. Still, the fact that it would not run in its own folder is perplexing.
When run without debugging, it works perfectly fine but when run with debugging, there is an error message: Exception has occurred: FileNotFoundError [Errno 2] No such file or directory: 'piratein.txt'
input = open("piratein.txt")
distances = (input.readlines())
l = int(distances[0])
x = int(distances[1])
y = int(distances[2])
if x+y<l:
write = str(x+y)
elif x+y>l:
write = str((l-x)+(l-y))
#creates and opens an output file for writing
output = open("pirateout.txt", "w")
output.write(write)
#the input file is only 3 lines, each with a single integer
#the path of the input file is "\CODING\VisualStudioCode\Informatics Olympiad\AIO_PRACTICE\piratein.txt"
#and the python file is in the same folder as the input file