Bug in 5/9?



Says there is no such directory as text.txt

my_file = open("text.txt", "r")



So, I believe you are getting an error like this:

Traceback (most recent call last):
  File "python", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'text.txt'

I am not inclined to calling it a bug, though.

There are two ways to resolving this:

You either open text.txt and type in a string, like "Success!" or write this in python.

with open("text.txt", "w") as textfile:

Python Lesson 5 ERROR? (Reading Between the Lines - File Input/Output)

yea I solved it by watching an another thread and changed the text


Okay, that's great.

Have fun coding! :keyboard: :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.