I'am new here, and also to programming. Currently, I'm practicing with Python.
#Opens a file
text_file=open('poep.txt', 'r')
#Reads lines from file and displays them on the screen
firstline=text_file.readline()
secondline=text_file.readline()
print(firstline)
print(secondline)
text_file.close()
print("Press any key to exit...")
closeInput = input()
print("Closing...")
The code above is supposed to show the text in the 'poep.txt' file. But when i open it with cmd/k(to prevent it from closing imediately) it says there is no such file or directory. I created the file myself and stored it on my dropbox. It is connected as I'm able to store and open other files on my dropbox.
What am i doing wrong?


View Solution