Re: [Tutor] grave confusion

2014-10-06 Thread Danny Yoo
Alan has pointed out that your loop here: for line_in in file.readline(): ... has a much different meaning that the one you intend. It means: "for every character in the first line of the file: ..." The reason is because "file.readline()" returns a line of your file as a string. A

Re: [Tutor] grave confusion

2014-10-06 Thread Alan Gauld
On 06/10/14 11:48, Alan Gauld wrote: Mostly the fact that readline() reads a line() ... Oops, Got a bit over enamoured with the parentheses there. Should just be plain 'line' of course. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/ala

Re: [Tutor] grave confusion

2014-10-06 Thread Alan Gauld
On 06/10/14 03:19, Clayton Kirkwood wrote: Here's my problem; my code snippet reads a file(presumably an _io.readline, I'll question this later), with the file.readline(). Nope, it reads a line from a file. That's quite a different thing. The output shows individual characters being read and

[Tutor] grave confusion

2014-10-06 Thread Clayton Kirkwood
Here's my problem; my code snippet reads a file(presumably an _io.readline, I'll question this later), with the file.readline(). The output shows individual characters being read and printed out followed by the "here" being printed. Also, see below. Source data file: html class="yui3-js-e