<div>Your problem is right here:</div><div><br></div><div>&gt;&gt;&gt; whole=file.read<br>&gt;&gt;&gt; print whole</div><div><br></div><div>Your re-assigning the method &quot;read()&quot;, which is a method of the object &quot;file&quot; to the variable &quot;whole&quot;</div>
<div><br></div><div>So, when you print &quot;whole&quot; you can see that it is printing the location of the method in memory. If you were to print file.read you would get the same results.</div><div><br></div><div>Now, to call the method (or a function) you need to add the parentheses with any arguments that it may need. In your case, you need to do &quot;read()&quot;.</div>
<div><br></div><div>This principle holds true with any object.</div><div><br></div><div>So, let&#39;s say we created a list object by doing this mylist = []</div><div><br></div><div>mylist now has all of the methods that a list has. So, for example, I can append something to the list by going:</div>
<div><br></div><div>mylist.append(1)</div><div><br></div><div>printing my list will show a list like this [1]</div><div><br></div><div><div>IDLE 2.6.5      </div><div>&gt;&gt;&gt; mylist = []</div><div>&gt;&gt;&gt; mylist.append(1)</div>
<div>&gt;&gt;&gt; print mylist</div><div>[1]</div></div><div><br></div><div>but instead lets say I did this:</div><div><br></div><div><div>&gt;&gt;&gt; b = mylist.append</div><div>&gt;&gt;&gt; print b</div><div>&lt;built-in method append of list object at 0x0118FD50&gt;</div>
</div><div><br></div><div>Which can be handy if i needed to do appending all the time, for example:</div><div><br></div><div><div>&gt;&gt;&gt; b(1)</div><div>&gt;&gt;&gt; print mylist</div><div>[1, 1]</div></div><div><br>
</div><div>My last piece of advice here is, use the Python documentation in addition to googling. It&#39;s actually very readable (I think anyway)</div><br><br><div class="gmail_quote">On Fri, Jun 17, 2011 at 12:20 PM, Lisi <span dir="ltr">&lt;<a href="mailto:lisi.reisz@gmail.com">lisi.reisz@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello :-)<br>
<br>
I have got as far as I have,i.e. apparently succeeding in both opening and<br>
closing two different files, thanks to google, but my struggles to _do_<br>
something with a file that I have opened are getting me nowhere.  Here is my<br>
latest failure:<br>
<br>
&gt;&gt;&gt; file=open(&quot;/home/lisi/CHOOSING_SHOES.txt&quot;, &quot;r&quot;)<br>
&gt;&gt;&gt; file.close()<br>
&gt;&gt;&gt; file=open(&quot;/home/lisi/CHOOSING_SHOES.txt&quot;, &quot;r&quot;)<br>
&gt;&gt;&gt; whole=file.read<br>
&gt;&gt;&gt; print whole<br>
&lt;built-in method read of file object at 0xb74c48d8&gt;<br>
&gt;&gt;&gt; print &quot;%r&quot; % whole<br>
&lt;built-in method read of file object at 0xb74c48d8&gt;<br>
&gt;&gt;&gt; print &quot;whole is %r&quot; %whole<br>
whole is &lt;built-in method read of file object at 0xb74c48d8&gt;<br>
&gt;&gt;&gt; print &quot;whole is %r&quot; % whole<br>
whole is &lt;built-in method read of file object at 0xb74c48d8&gt;<br>
&gt;&gt;&gt;<br>
<br>
I&#39;d be extremely grateful if one of you was willing to drop a hint, give me<br>
some pointers (even e.g. guide me to asking the correct question of Google),<br>
or tell me where I am going wrong.<br>
<br>
In general, the author advises leaving any of the extra credit questions that<br>
you are struggling with and coming back to them later.  And in general I have<br>
found that that works.  But this set of extra-credit questions he advises<br>
mastering before moving on.  And I am stuck on this one at this stage. :-(<br>
(I think that I have cracked the others.)<br>
<br>
Thanks.<br>
<font color="#888888"><br>
Lisi<br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</font></blockquote></div><br>