You just have some mistakes in your problem:
- First, you haven't upload the file
vacation.txtyet. Make sure that you have created the file with the same name or upload it just by drag and drop!
- Second, you should know that you are using Repl.it, it isn't your computer, and don't have permission to access file in your computer, so, replace the first line:
one = open( r"D:\Users\rtagger\Desktop\vacation.txt", "r")
one = open( r"./vacation.txt", "r")
- Third, why would you need an
rbefore the strings on the first line?
I can be pretty strict, but did you know that the
r before the string means that
This string is a Regex rule? So, remove it, it's unnecessary:
Now, I bet that you will get a much better code! :)
For one thing repl.it doesn't support those kind of files. You might want to use normal files like
file.txt. So you also have to make the file first if you are using read mode.
one = open"file.txt", "r") all_one = one.read() print(all_one)
now you have to make
file.txt. And after you do that. If you are in read mode, you can write something in that file, and when you run it. The console will read the file.
That should work