On Thu, May 21, 2015 at 4:31 PM, Ben Finney <ben+pyt...@benfinney.id.au> wrote:
>>>> "{foo:d}".format(foo=foo)
> '4567'
>>>> "{foo:b}".format(foo=foo)
> '1000111010111'

Which since there's nothing else in the format string can be simplified to:

>>> format(foo, "b")
'1000111010111'
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to