Re: Colors for Rows

2008-05-05 Thread [EMAIL PROTECTED]
> On Tue, 29 Apr 2008 09:33:32 -0500 > "Victor Subervi" <[EMAIL PROTECTED]> wrote: > print '' % bg You'd better learn to use css instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: Colors for Rows

2008-05-04 Thread Scott David Daniels
D'Arcy J.M. Cain wrote: On Tue, 29 Apr 2008 15:03:23 -0400 "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: Or, if you aren't sure how many colors you'll be using, try the more robust: bg[z % len(bg)] Good point although I would have calculated the length once at the start rather than each time thr

Re: Colors for Rows

2008-04-30 Thread D'Arcy J.M. Cain
On Wed, 30 Apr 2008 11:03:34 -0500 "Victor Subervi" <[EMAIL PROTECTED]> wrote: > The problem was that z was not incrementing. It kept getting reset to 3, > then incremented to 4 immediately, and reset back to 3. Stupid :/ Not in the code you actually posted. As I said earlier, create the script t

Re: Colors for Rows

2008-04-30 Thread Victor Subervi
The problem was that z was not incrementing. It kept getting reset to 3, then incremented to 4 immediately, and reset back to 3. Stupid :/ On Wed, Apr 30, 2008 at 11:01 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Wed, 30 Apr 2008 10:57:44 -0500 > "Victor Subervi" <[EMAIL PROTECTED]> wrot

Re: Colors for Rows

2008-04-30 Thread D'Arcy J.M. Cain
On Wed, 30 Apr 2008 10:57:44 -0500 "Victor Subervi" <[EMAIL PROTECTED]> wrote: > Thank you all. You helped clean up my code. The stupid mistake was in where > I set the initial value of the variable z. Really? I thought that it was odd to start in the middle of your colour list but it didn't seem

Re: Colors for Rows

2008-04-30 Thread Victor Subervi
Thank you all. You helped clean up my code. The stupid mistake was in where I set the initial value of the variable z. Victor On Tue, Apr 29, 2008 at 3:20 PM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > On Tue, 2008-04-29 at 15:39 -0400, D'Arcy J.M. Cain wrote: > > On Tue, 29 Apr 2008 15:03:23 -04

Re: Colors for Rows

2008-04-29 Thread J. Cliff Dyer
On Tue, 2008-04-29 at 15:39 -0400, D'Arcy J.M. Cain wrote: > On Tue, 29 Apr 2008 15:03:23 -0400 > "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > > Or, if you aren't sure how many colors you'll be using, try the more > > robust: > > > > bg[z % len(bg)] > > Good point although I would have calculated

Re: Colors for Rows

2008-04-29 Thread D'Arcy J.M. Cain
On Tue, 29 Apr 2008 15:03:23 -0400 "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > Or, if you aren't sure how many colors you'll be using, try the more > robust: > > bg[z % len(bg)] Good point although I would have calculated the length once at the start rather than each time through the loop. --

Re: Colors for Rows

2008-04-29 Thread D'Arcy J.M. Cain
On Tue, 29 Apr 2008 13:14:34 -0500 "Victor Subervi" <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 11:11 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > > > for d in (1,2,3,4,5,6): > > > > I changed id to a sequence so that the example actually runs. Please > > run your examples first and

Re: Colors for Rows

2008-04-29 Thread J. Cliff Dyer
On Tue, 2008-04-29 at 13:14 -0500, Victor Subervi wrote: > On Tue, Apr 29, 2008 at 11:11 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> > wrote: > On Tue, 29 Apr 2008 09:33:32 -0500 > "Victor Subervi" <[EMAIL PROTECTED]> wrote: > > why doesn't this work? > > >

Re: Colors for Rows

2008-04-29 Thread Joe Riopel
On Tue, Apr 29, 2008 at 10:33 AM, Victor Subervi <[EMAIL PROTECTED]> wrote: > Hi; > > > why doesn't this work? > It never increments z! Yet, if I print z, it will increment and change the > bgcolor! Why?! Are you only trying to "print '\n' % bg" once, or for each iteration of the loop? It might

Re: Colors for Rows

2008-04-29 Thread Victor Subervi
On Tue, Apr 29, 2008 at 11:11 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Tue, 29 Apr 2008 09:33:32 -0500 > "Victor Subervi" <[EMAIL PROTECTED]> wrote: > > why doesn't this work? > > First, let me remove some blank lines to reduce scrolling. > > > z = 3 > > > > for d in (1,2,3,4,5,6): > >

Re: Colors for Rows

2008-04-29 Thread D'Arcy J.M. Cain
On Tue, 29 Apr 2008 09:33:32 -0500 "Victor Subervi" <[EMAIL PROTECTED]> wrote: > why doesn't this work? First, let me remove some blank lines to reduce scrolling. > z = 3 > > for d in (1,2,3,4,5,6): I changed id to a sequence so that the example actually runs. Please run your examples first an

Colors for Rows

2008-04-29 Thread Victor Subervi
Hi; why doesn't this work? z = 3 for d in id: z += 1 if z % 4 == 0: bg = '#ff' elif z % 4 == 1: bg = '#d2d2d2' elif z % 4 == 2: bg = '#F6E5DF' else: bg = '#EAF8D5' try: print '\n' % bg except: print '\n' It never increments z! Yet, if I print z,