Hello,
why the following code is not working as i expect it to :
Code:
#!/usr/bin/python
from_file ="file.txt"
in_file = open(from_file)
str = in_file.read()
print "Here should be the output from the file - ", in_file.read()
print "Here should be the output from the STR- ", str
in_file.close()
The output is :
Here should be the output from the file -
Here should be the output from the STR- BLAH
in other words print "". in_file.read() doesn't seem to work. I wonder why?