Reading


#1


This Is The Link To My Exercise:
https://www.codecademy.com/courses/python-intermediate-en-OGNHh/0/4?curriculum_id=4f89dab3d788890003000096#

Error Message From Console:
Traceback (most recent call last):
File "python", line 1, in
IOError: [Errno 2] No such file or directory: 'output.txt'

Error Message From Codecademy:
Oops, try again. Did you create a variable called my_file?

I expected to Get it Right But.....


my_file=open('output.txt', 'r')
print my_file.read()
my_file.close()

Earlier Many People Told To Refresh Their Tabs But Still....NOT WORKING!

Please Help!

Thanks!


#2

I went to the ouput.txt tab, added something on a new line, deleted it.
Then I went back to the script.py tab, retyped my_file in the first line and it worked.
Try that.


#3

I tried To do the same.....But Actually I Figured It Out!

What Happens Is You Wanna Delete All The Values or Data in output.txt and then try to run Your Same Code!

It Works!


#4

Yea that too. If the same thing happens, just do that or do something to the output.txt. Sometimes, it forgets output.txt exists...


#5

Yes, It does Forget..


#6

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