A file I wrote in Python on VSCode, which had previously been successful, suddenly doesn´t recognize the .txt file used. It reutrned this when I input my text file:
FileNotFoundError: [Errno 2] No such file or directory: 'romeo.txt'
I´m not sure why this is. If anyone has any insights, it would be helpful! For reference I will post the code below.
fname = input("Enter file name: ")
fh = open(fname)
fh = fh.read()
txt = fh.split()
lst = list()
for line in txt:
if line not in lst:
lst.append(line)
lst.sort()
print(lst)