I noticed when I try to iterate over a file with lines such as
“python”
“please”
“work”
I only get individual characters back, such as,
“p”
“y”
“t”…
how could I get it to give me the full word? I’ve been trying a couple hours and can’t find a method. I’m using the newest version of python.
Edit: All the quotation marks are new lines.
You can iterate over a file object:
See the docs for the details:
http://docs.python.org/2/library/stdtypes.html#bltin-file-objects