On Friday 17 June 2011 17:42:29 Walter Prins wrote:
> On 17 June 2011 17:20, Lisi wrote:
> > >>> file=open("/home/lisi/CHOOSING_SHOES.txt", "r")
> > >>> file.close()
> > >>> file=open("/home/lisi/CHOOSING_SHOES.txt", "r")
> > >>> whole=file.read
> > >>> print whole
> >
> >
> >
> > >>> print "%r"
Your problem is right here:
>>> whole=file.read
>>> print whole
Your re-assigning the method "read()", which is a method of the object
"file" to the variable "whole"
So, when you print "whole" you can see that it is printing the location of
the method in memory. If you were to print file.read yo
On 17 June 2011 17:20, Lisi wrote:
> >>> file=open("/home/lisi/CHOOSING_SHOES.txt", "r")
> >>> file.close()
> >>> file=open("/home/lisi/CHOOSING_SHOES.txt", "r")
> >>> whole=file.read
> >>> print whole
>
> >>> print "%r" % whole
>
> >>> print "whole is %r" %whole
> whole is
> >>> print "whole