Re: complete brain fart, it doesn't loop

2014-07-28 Thread Martin S
That's neat. I was only aware of the return version. Anyway, got it working now, simplifying the code in the process. So all was not lost. /Martin S 2014-07-28 9:09 GMT+02:00 Peter Otten <__pete...@web.de>: > Chris Angelico wrote: > >> On Mon, Jul 28, 2014 at 4:07 AM, Peter Otten <__pete...@web.

Re: complete brain fart, it doesn't loop

2014-07-28 Thread Chris Angelico
On Mon, Jul 28, 2014 at 5:09 PM, Peter Otten <__pete...@web.de> wrote: > > It was just a guess, but as the OP uses bottle, here's a modified > "hello world" from the bottle site > : > (snip example of yielding text to the web browse

Re: complete brain fart, it doesn't loop

2014-07-28 Thread Peter Otten
Chris Angelico wrote: > On Mon, Jul 28, 2014 at 4:07 AM, Peter Otten <__pete...@web.de> wrote: >> By the way, Python has something similar to a function that temporarily >> interrupts execution but preserves state. It's called generator. > > Yeah, but I have a suspicion his web framework (which h

Re: complete brain fart, it doesn't loop

2014-07-27 Thread Martin S
I'm using Bottle as suggested earlier. And yes, I'm collecting results from a html table passed to the server for processing. /martin On 27 Jul 2014, Chris Angelico wrote: >On Mon, Jul 28, 2014 at 4:07 AM, Peter Otten <__pete...@web.de> wrote: >> By the way, Python has something similar to a

Re: complete brain fart, it doesn't loop

2014-07-27 Thread Martin S
Ah, thanks. Explains it all :) /martin On 27 Jul 2014, Peter Otten <__pete...@web.de> wrote: >Chris Angelico wrote: > >> On Mon, Jul 28, 2014 at 3:53 AM, Martin S >wrote: >>> I have this snippet in my web application. Question is why doesn't >the >>> stupid thing loop ten times? It loops exact

Re: complete brain fart, it doesn't loop

2014-07-27 Thread Chris Angelico
On Mon, Jul 28, 2014 at 4:17 AM, Terry Reedy wrote: > the problem can hardly be missed. > My brain's gone across to The Mikado, here, and a well-known song of the Executioner's. The solution might even be to collect up the intermediate strings in a mutable sequence... yes, indeed, "you may put th

Re: complete brain fart, it doesn't loop

2014-07-27 Thread Terry Reedy
On 7/27/2014 1:55 PM, Chris Angelico wrote: On Mon, Jul 28, 2014 at 3:53 AM, Martin S wrote: I have this snippet in my web application. Question is why doesn't the stupid thing loop ten times? It loops exactly 1 time. One thing we repeatedly tell people who post code with problems (here or o

Re: complete brain fart, it doesn't loop

2014-07-27 Thread Chris Angelico
On Mon, Jul 28, 2014 at 4:07 AM, Peter Otten <__pete...@web.de> wrote: > By the way, Python has something similar to a function that temporarily > interrupts execution but preserves state. It's called generator. Yeah, but I have a suspicion his web framework (which he hasn't identified, but I susp

Re: complete brain fart, it doesn't loop

2014-07-27 Thread Peter Otten
Chris Angelico wrote: > On Mon, Jul 28, 2014 at 3:53 AM, Martin S wrote: >> I have this snippet in my web application. Question is why doesn't the >> stupid thing loop ten times? It loops exactly 1 time. >> >> # Reset counter >> counter = 0 >> >> while counter <= 10: >> >> retur

Re: complete brain fart, it doesn't loop

2014-07-27 Thread Chris Angelico
On Mon, Jul 28, 2014 at 3:53 AM, Martin S wrote: > I have this snippet in my web application. Question is why doesn't the > stupid thing loop ten times? It loops exactly 1 time. > > # Reset counter > counter = 0 > > while counter <= 10: > > return "Long line with games" > >