I am new to python, learning data structures now. and i got stuck with files. I felt this very unusual, can anyone help me with a good reason why this is happening. here is my code.
(this is the link for text file http://www.pythonlearn.com/code/romeo.txt)
fh = open('romeo.txt')
for line in fh:
print line
Output:
But soft what light through yonder window breaks
It is the east and Juliet is the sun
Arise fair sun and kill the envious moon
Who is already sick and pale with grief
for line in fh:
print line
Here I am not able to print the lines using fh for the second time, it outputs nothing.