Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
saiyr
May 23, 2004

Git posted:

Really though, Django might be overkill but it makes development fly by. I can't recommend it enough, but if you're absolutely certain that it won't suit, you might do well to look at the smaller frameworks like Pylons or CherryPy. Actually, you've a hell of a lot of frameworks you could choose from if any one doesn't suit.
Hmm, I don't really think Pylons is "small". It's small in the sense that you can swap out a lot of components, and the core code isn't really that big, but it's still very Rails-like/big. CherryPy is a bit more manageable. Web.py is pretty small as well. Reddit used it for one of their billions of rewrites and rewrote the entire site in a weekend or something.

Adbot
ADBOT LOVES YOU

saiyr
May 23, 2004

my stepdads beer posted:

How do you reset an iterator in a for loop?
code:
switch = True

for i in range(0, 5):
	print i

	if (i == 4) and (switch == True):
		i = 0
		switch = False
Why doesn't this loop twice?
I think you're stuck in C mode, where at the end of the loop you do i++. Python simply assigns the next value in the iterator to i until no values remain, which is why it doesn't loop twice. It's probably cleaner to put the number of repetitions you want in an outer loop, instead:

code:
for j in range(2):
    for i in range(5):
        print i

  • Locked thread