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


#1

I Am getting Traceback (most recent call last):
File "python", line 1, in
IOError: [Errno 2] No such file or directory: 'text.txt' error while trying to submit my answer and its also showing "Oops, try again. Sorry, but I'm gonna need you to refresh the page! Don't worry your code is saved." But even after refreshing page multiple type i am getting same error
my_file=open("text.txt",'r')
print my_file.readline()
my_file.close()


#2

Please click on this topic You will find your answer. :slight_smile:


#3

Hi ,

Still getting the same error.


#4

Open the text file and write some text , then your code should work. :slight_smile:


#5

Hey bandit http://discuss.codecademy.com/users/bandit,
thanks , it worked , completed python :slight_smile:


#6

You're welcome :slight_smile:, Congratulations! :grin: This is just the beginning :smile:


#7

Is this part of learning to use Google and FAQs or what? XD
And what do you mean by "This is just the beginning?"


#8

Do you mean the python course?

I mean, Python is a very diverse programming language of which there is so much more to learn! :slight_smile:


#9

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