+1 vote
by
Here's the code.
s = input("Enter directory to file with: \n")
sleep(2)
f = open(s + ".txt", "r")
print(f.read() + "\n")
w = input("Repeat? y/n\n")
if w == "y":
sleep(2)
def paste(text013: str):
pyperclip.copy(text013)
press_and_release('ctrl + v')

paste(f.read() + "\n")
paste(f.read() + "\n")
paste(f.read() + "\n")
paste(f.read() + "\n")
paste(f.read() + "\n")
if w == "n":
def paste(text014: str):
pyperclip.copy(text014)
press_and_release('ctrl + v')
f = open(s, "r")
paste(f.read() + "\n")
It says in the console:
Traceback (most recent call last): File "C:\Users\Admin\Desktop\DragonHack\OWOTRAIDv2.py", line 238, in <module> f = open(s, "r")FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Admin\\Desktop\\DragonHack\\sword'</blockquote>

3 Answers

0 votes
by
Location:
f = open(s + ".txt", "r")

Seat Two:
f = open(s, "r")

Obviously, if it fails on the second, you need to add an extension to the file name.
by
nothing has changed
Traceback (most recent call last):
File "C:\Users\Admin\Desktop\DragonHack\OWOTRAIDv2.py", line 220, in
f = open(s + ".txt", "r")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Admin\\Desktop\\DragonHack.txt.txt'
by
What's wrong with you - first the error was a file without an extension, and now the extension is added twice.
0 votes
by
1) You need to give an informative title to the question;
2) The code must be enclosed in a special tag;
3) There is no sword file in the DragonHack folder.
by
Jau ,
f = open(s, "r")
paste(f.read() + "\n")
by
there s + ".txt" "r"
0 votes
by
Is that:
1. can't read mistakes
2. can't read the rules of the site
...