Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71528

Re: New to Python. For in loops curiosity

Newsgroups comp.lang.python
Date 2014-05-13 20:48 -0700
References <2f08e970-1334-4e7f-ba84-14869708a73b@googlegroups.com>
Message-ID <a651ad84-c4b9-4824-87d3-cb35d920fc77@googlegroups.com> (permalink)
Subject Re: New to Python. For in loops curiosity
From Rustom Mody <rustompmody@gmail.com>

Show all headers | View raw


On Wednesday, May 14, 2014 9:08:32 AM UTC+5:30, Leonardo Petry wrote:
> 
> This is just too convenient. 
> 
> Basically my question is: Why is python not treating the contents of wordplay.txt as one long string and looping each character?

Did you mean convenient or inconvenient?

Anyways...

Maybe you want the read method?
https://docs.python.org/2/tutorial/inputoutput.html#methods-of-file-objects

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

New to Python. For in loops curiosity Leonardo Petry <leonardo.petry.br@gmail.com> - 2014-05-13 20:38 -0700
  Re: New to Python. For in loops curiosity John Gordon <gordon@panix.com> - 2014-05-14 03:46 +0000
  Re: New to Python. For in loops curiosity Rustom Mody <rustompmody@gmail.com> - 2014-05-13 20:48 -0700
  Re: New to Python. For in loops curiosity Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-13 21:49 -0600
  Re: New to Python. For in loops curiosity Ben Finney <ben@benfinney.id.au> - 2014-05-14 14:03 +1000
  Re: New to Python. For in loops curiosity Roy Smith <roy@panix.com> - 2014-05-14 07:38 -0400
  Re: New to Python. For in loops curiosity Ned Batchelder <ned@nedbatchelder.com> - 2014-05-14 09:41 -0400

csiph-web