diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-05-09 00:50:40 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-05-09 00:50:40 (GMT) |
commit | d03238a6473cbf5d81d9d99c71e1bab36c3455d8 (patch) | |
tree | 9f0d99852f549a4c71b2b206b5fb34d7214c1584 | |
parent | e404a12a46485641ec69db0cf3bd507e210b31b4 (diff) | |
download | cpython-d03238a6473cbf5d81d9d99c71e1bab36c3455d8.zip cpython-d03238a6473cbf5d81d9d99c71e1bab36c3455d8.tar.gz cpython-d03238a6473cbf5d81d9d99c71e1bab36c3455d8.tar.bz2 |
reindent example
-rw-r--r-- | Doc/library/tempfile.rst | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index 79fa391..b5682ae 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -168,23 +168,23 @@ The module defines the following user-callable functions: By the time you get around to doing anything with the file name it returns, someone else may have beaten you to the punch. :func:`mktemp` usage can be replaced easily with - :func:`NamedTemporaryFile`, passing it the `delete=False` parameter :: - - >>> f = NamedTemporaryFile(delete=False) - >>> print f.name - >>> f.write("Hello World!\n") - >>> f.close() - >>> os.unlink(f.name) - >>> f = NamedTemporaryFile(delete=False) - >>> f - <open file '<fdopen>', mode 'w+b' at 0x384698> - >>> f.name - '/var/folders/5q/5qTPn6xq2RaWqk+1Ytw3-U+++TI/-Tmp-/tmpG7V1Y0' - >>> f.write("Hello World!\n") - >>> f.close() - >>> os.unlink(f.name) - >>> os.path.exists(f.name) - False + :func:`NamedTemporaryFile`, passing it the `delete=False` parameter:: + + >>> f = NamedTemporaryFile(delete=False) + >>> print f.name + >>> f.write("Hello World!\n") + >>> f.close() + >>> os.unlink(f.name) + >>> f = NamedTemporaryFile(delete=False) + >>> f + <open file '<fdopen>', mode 'w+b' at 0x384698> + >>> f.name + '/var/folders/5q/5qTPn6xq2RaWqk+1Ytw3-U+++TI/-Tmp-/tmpG7V1Y0' + >>> f.write("Hello World!\n") + >>> f.close() + >>> os.unlink(f.name) + >>> os.path.exists(f.name) + False The module uses two global variables that tell it how to construct a temporary name. They are initialized at the first call to any of the |