In <[EMAIL PROTECTED]>, Why Tea wrote:

> print format % values
> An optional minimum width of the conversion, specified using one or
> more digits or an asterisk (*), which means that the width is taken
> from the next item in values
> 
> That's from one of O'reilly's books. But there is no example and I
> couldn't get it to work by trials and errors. Does anyone have a
> working example?

In [50]: '%*s' % (5, 'spam')
Out[50]: ' spam'

In [51]: '%*s' % (10, 'spam')
Out[51]: '      spam'

In [52]: '%*s' % (15, 'spam')
Out[52]: '           spam'

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to