I have a text file "numbers.txt" which contains a single line :
1
To determine whether this string is a digit or not I am doing this :
>>> fr = open("number.txt","r")
>>> line = fr.open()
>>> print line,type(line)
1
<type 'str'>
which is correct but then, when I do this,
>>> line.isdigit()
False
I have checked the following too:
>>> '1'.isdigit()
True
So why can't be it, when I read it from file?
Thanks in advance for any ideas and solutions.