Bug in 5/9?


#1



https://www.codecademy.com/en/courses/python-intermediate-en-OGNHh/1/1?curriculum_id=4f89dab3d788890003000096#


Says there is no such directory as text.txt
https://gyazo.com/634b58adafdce8437d017477504591d1


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

my_file.close()


#2

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:
	textfile.write("Success!")

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

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


#4

Okay, that's great.

Have fun coding! :keyboard: :slight_smile:


#5

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