mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Merged revisions 63655 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r63655 | benjamin.peterson | 2008-05-25 19:54:22 -0500 (Sun, 25 May 2008) | 2 lines update the tutorial to use str.format ........
This commit is contained in:
parent
dc6c16ac63
commit
e6f00637be
7 changed files with 84 additions and 34 deletions
|
|
@ -116,7 +116,7 @@ placeholders such as the current date, image sequence number, or file format::
|
|||
>>> for i, filename in enumerate(photofiles):
|
||||
... base, ext = os.path.splitext(filename)
|
||||
... newname = t.substitute(d=date, n=i, f=ext)
|
||||
... print('%s --> %s' % (filename, newname))
|
||||
... print('{0} --> {1}'.format(filename, newname))
|
||||
|
||||
img_1074.jpg --> Ashley_0.jpg
|
||||
img_1076.jpg --> Ashley_1.jpg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue