Il 14/04/2021 18:13, Quentin Bock ha scritto:
I receive this error when I try to open a file
The file (what I'm trying to open) is in the same folder as the program I'm
trying to open it from; why is it saying no such file or directory?

this is the only part of the code that causes the error

file = open('Egils Saga 1-15.txt', "r")

file.close()


>>> file = open('Egils Saga 1-15.txt', "r")
>>> file.read()
'Hello from Egils Saga 1-15.txt'
>>> file.close()

Try to check your 'current working directory':

>>> import os
>>> os.getcwd()
'D:\\tmp'        # where the file is
>>>
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to