[Tutor] A file containing a string of 1 billion random digits.
Richard D. Moores
rdmoores at gmail.com
Mon Jul 19 17:42:51 CEST 2010
On Mon, Jul 19, 2010 at 08:01, Steven D'Aprano <steve at pearwood.info> wrote:
> On Tue, 20 Jul 2010 12:48:13 am Richard D. Moores wrote:
> You're looking in the wrong place. This is not part of format strings,
> as it doesn't use the str.format() method. It uses the % string
> interpolation operator.
>
> http://docs.python.org/py3k/library/stdtypes.html#old-string-formatting-operations
Yes. I now see the asterisk use in 4. But also:
Note
The formatting operations described here are obsolete and may go away
in future versions of Python. Use the new String Formatting in new
code.
I hope that use of '*' does disappear. It's the most confusing thing
I've recently tried to get my mind around! Before that, maybe, was the
Trinity..
> You can get the same result with the format mini-language. See the
> example "Nested arguments and more complex examples" just before the
> section on Template Strings here:
>
> http://docs.python.org/py3k/library/string.html#format-specification-mini-language
OK, I'll try to sink my teeth into this. I just found that Learning
Python, 4th ed. has a discussion of all of this beginning at p.181 in
the book, or p.233 in the PDF.
Thanks, Steve.
Dick
More information about the Tutor
mailing list