Re: Have a variable column length in printf

2009-05-31 Thread Cameron Pulsford
Thanks all, I think I'l stick with the '*' method because this is just a one time thing for a __repr__ function and it seems easiest. On Sun, May 31, 2009 at 6:32 AM, Terry Reedy wrote: > Gary Herron wrote: > >> Cameron Pulsford wrote: >> >>> Hello all, I'm trying to pretty print a list, so I am

Re: Have a variable column length in printf

2009-05-31 Thread Terry Reedy
Gary Herron wrote: Cameron Pulsford wrote: Hello all, I'm trying to pretty print a list, so I am doing something like print '%3d' % integer only I would like that 3 to be a variable, instead of hardcoded. Is this possible, or are there any other ways to accomplish this? Thanks! Use a '*' i

Re: Have a variable column length in printf

2009-05-31 Thread Steven D'Aprano
Apologies for breaking threading, the original post to this thread is not on my newserver. Cameron Pulsford wrote: > Hello all, I'm trying to pretty print a list, so I am doing something > like > > print '%3d' % integer Instead of re-inventing the wheel, have you looked at the pretty-print m

Re: Have a variable column length in printf

2009-05-31 Thread Gary Herron
Cameron Pulsford wrote: Hello all, I'm trying to pretty print a list, so I am doing something like print '%3d' % integer only I would like that 3 to be a variable, instead of hardcoded. Is this possible, or are there any other ways to accomplish this? Thanks! Use a '*' instead of fixed widt

Re: Have a variable column length in printf

2009-05-31 Thread Emile van Sebille
On 5/30/2009 10:58 PM Cameron Pulsford said... Hello all, I'm trying to pretty print a list, so I am doing something like print '%3d' % integer only I would like that 3 to be a variable, instead of hardcoded. Is this possible, or are there any other ways to accomplish this? Thanks! >>> int

Have a variable column length in printf

2009-05-30 Thread Cameron Pulsford
Hello all, I'm trying to pretty print a list, so I am doing something like print '%3d' % integer only I would like that 3 to be a variable, instead of hardcoded. Is this possible, or are there any other ways to accomplish this? Thanks! -- http://mail.python.org/mailman/listinfo/python-list