Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #7201
| References | <mailman.1.1307482621.11593.python-list@python.org> <ism61s$grp$1@speranza.aioe.org> |
|---|---|
| Date | 2011-06-08 09:26 +1000 |
| Subject | Re: Dynamic Zero Padding. |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.9.1307489204.11593.python-list@python.org> (permalink) |
On Wed, Jun 8, 2011 at 7:43 AM, Mel <mwilson@the-wire.com> wrote:
> :)
>
> ('%%0%dd' % (pads,)) % (n,)
>
> Probably be good to wrap it in a function. It looks kind of obscure as it
> is.
Would get rather pretty (read: ugly and impossible to read) if you
wanted to put a literal percent sign in front of the number.
:)
Chris Angelico
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Dynamic Zero Padding. Friedrich Clausen <fred@derf.nl> - 2011-06-07 23:36 +0200
Re: Dynamic Zero Padding. Mel <mwilson@the-wire.com> - 2011-06-07 17:43 -0400
Re: Dynamic Zero Padding. Chris Angelico <rosuav@gmail.com> - 2011-06-08 09:26 +1000
Re: Dynamic Zero Padding. Terry Reedy <tjreedy@udel.edu> - 2011-06-07 22:56 -0400
Re: Dynamic Zero Padding. Friedrich Clausen <fred@derf.nl> - 2011-06-08 09:00 +0200
Re: Dynamic Zero Padding. harrismh777 <harrismh777@charter.net> - 2011-06-07 16:55 -0500
csiph-web