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
9dd8dc3f
Kaydet (Commit)
9dd8dc3f
authored
Tem 27, 2006
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add example
üst
75a832d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
libstringio.tex
Doc/lib/libstringio.tex
+37
-0
No files found.
Doc/lib/libstringio.tex
Dosyayı görüntüle @
9dd8dc3f
...
@@ -37,6 +37,24 @@ such mixing can cause this method to raise \exception{UnicodeError}.
...
@@ -37,6 +37,24 @@ such mixing can cause this method to raise \exception{UnicodeError}.
Free the memory buffer.
Free the memory buffer.
\end{methoddesc}
\end{methoddesc}
Example usage:
\begin{verbatim}
import StringIO
output = StringIO.StringIO()
output.write('First line.
\n
')
print >>output, 'Second line.'
# Retrieve file contents -- this will be
# 'First line.
\nSecond
line.
\n
'
contents = output.getvalue()
# Close object and discard memory buffer --
# .getvalue() will now raise an exception.
output.close()
\end{verbatim}
\section
{
\module
{
cStringIO
}
---
\section
{
\module
{
cStringIO
}
---
Faster version of
\module
{
StringIO
}}
Faster version of
\module
{
StringIO
}}
...
@@ -82,3 +100,22 @@ The following data objects are provided as well:
...
@@ -82,3 +100,22 @@ The following data objects are provided as well:
There is a C API to the module as well; refer to the module source for
There is a C API to the module as well; refer to the module source for
more information.
more information.
Example usage:
\begin{verbatim}
import cStringIO
output = cStringIO.StringIO()
output.write('First line.
\n
')
print >>output, 'Second line.'
# Retrieve file contents -- this will be
# 'First line.
\nSecond
line.
\n
'
contents = output.getvalue()
# Close object and discard memory buffer --
# .getvalue() will now raise an exception.
output.close()
\end{verbatim}
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