Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Dick Moores
At 12:35 PM 11/2/2006, Kent Johnson wrote: >Dick Moores wrote: >>At 11:33 AM 11/2/2006, Markus Rosenstihl wrote: >>>Try somthing like this: >>> >>>In [32]: a=range(100) >>>In [33]: for i in range(0,len(a)): >>> : print '%-27s'%a[i], >>> : if (i+1)%3 == 0: print "\n" >>> >>>0

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Kent Johnson
Dick Moores wrote: > At 11:33 AM 11/2/2006, Markus Rosenstihl wrote: >> Try somthing like this: >> >> In [32]: a=range(100) >> In [33]: for i in range(0,len(a)): >> : print '%-27s'%a[i], >> : if (i+1)%3 == 0: print "\n" >> >> 0 1

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Dick Moores
At 11:51 AM 11/2/2006, Kent Johnson wrote: >Dick Moores wrote: >>Oops! Got overconfident. Didn't check to see if it actually printed >>the whole list. It didn't. Left off "rad: radian", because there >>are 46 items in the list (46%3 is 1, not 0). So now the only way I >>could see to print all 46

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Dick Moores
At 11:33 AM 11/2/2006, Markus Rosenstihl wrote: >Try somthing like this: > >In [32]: a=range(100) >In [33]: for i in range(0,len(a)): > : print '%-27s'%a[i], > : if (i+1)%3 == 0: print "\n" > >0 1 2 > >3

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Kent Johnson
Dick Moores wrote: > Oops! Got overconfident. Didn't check to see if it actually printed > the whole list. It didn't. Left off "rad: radian", because there are > 46 items in the list (46%3 is 1, not 0). So now the only way I could > see to print all 46 was to add 2 empty dummies to make 48, whic

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Markus Rosenstihl
Am 02.11.2006 um 15:14 schrieb Dick Moores: > At 03:31 AM 11/2/2006, you wrote: >> At 03:13 AM 11/2/2006, Kent Johnson wrote: >>> Luke Paireepinart wrote: Instead of helping you with your specific problem, I'll give you this information and see what you can make of it. >

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Dick Moores
At 03:31 AM 11/2/2006, you wrote: >At 03:13 AM 11/2/2006, Kent Johnson wrote: > >Luke Paireepinart wrote: > > > Instead of helping you with your specific problem, I'll give you this > > > information and see what you can make of it. > > > > > > >>> print 'a'.ljust(20)+'b'.ljust(20) > > > a

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Dick Moores
At 03:13 AM 11/2/2006, Kent Johnson wrote: >Luke Paireepinart wrote: > > Instead of helping you with your specific problem, I'll give you this > > information and see what you can make of it. > > > > >>> print 'a'.ljust(20)+'b'.ljust(20) > > a b > > >>> print 'carrah'.ljust(20)+

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Kent Johnson
Luke Paireepinart wrote: > Instead of helping you with your specific problem, I'll give you this > information and see what you can make of it. > > >>> print 'a'.ljust(20)+'b'.ljust(20) > a b > >>> print 'carrah'.ljust(20)+'foobar'.ljust(20) > carrah

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Dick Moores
At 01:45 AM 11/2/2006, Luke Paireepinart wrote: >Instead of helping you with your specific problem, I'll give you this >information and see what you can make of it. > > >>> print 'a'.ljust(20)+'b'.ljust(20) >a b > >>> print 'carrah'.ljust(20)+'foobar'.ljust(20) >carrah

Re: [Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Luke Paireepinart
Instead of helping you with your specific problem, I'll give you this information and see what you can make of it. >>> print 'a'.ljust(20)+'b'.ljust(20) a b >>> print 'carrah'.ljust(20)+'foobar'.ljust(20) carrah foobar Notice how t

[Tutor] Need to be taught a trick or two about printing in neat columns

2006-11-02 Thread Dick Moores
I'm working on a program named unitConversion.py. In it, I give the user a chance to see a list of all the measurement units the program handles, and their abbreviations. The user needs the abbreviations to do the conversions. So I have a couple of functions (see below) that together will print