Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
810b94a3
Kaydet (Commit)
810b94a3
authored
Nis 10, 2011
tarafından
Ross Lagerwall
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11818: Fix tempfile examples for Python 3.
üst
dbb677a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
tempfile.rst
Doc/library/tempfile.rst
+5
-5
NEWS
Misc/NEWS
+5
-0
No files found.
Doc/library/tempfile.rst
Dosyayı görüntüle @
810b94a3
...
...
@@ -242,26 +242,26 @@ Here are some examples of typical usage of the :mod:`tempfile` module::
# create a temporary file and write some data to it
>>> fp = tempfile.TemporaryFile()
>>> fp.write('Hello world!')
>>> fp.write(
b
'Hello world!')
# read data from file
>>> fp.seek(0)
>>> fp.read()
'Hello world!'
b
'Hello world!'
# close the file, it will be removed
>>> fp.close()
# create a temporary file using a context manager
>>> with tempfile.TemporaryFile() as fp:
... fp.write('Hello world!')
... fp.write(
b
'Hello world!')
... fp.seek(0)
... fp.read()
'Hello world!'
b
'Hello world!'
>>>
# file is now closed and removed
# create a temporary directory using the context manager
>>> with tempfile.TemporaryDirectory() as tmpdirname:
... print
'created temporary directory', tmpdirname
... print
('created temporary directory', tmpdirname)
>>>
# directory and contents have been removed
Misc/NEWS
Dosyayı görüntüle @
810b94a3
...
...
@@ -257,6 +257,11 @@ Tests
- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
to open door files.
Documentation
-------------
- Issue #11818: Fix tempfile examples for Python 3.
What'
s
New
in
Python
3.2
?
=========================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment