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
bebe91a0
Kaydet (Commit)
bebe91a0
authored
Nis 21, 2013
tarafından
Ned Deily
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #17670: Provide an example of expandtabs() usage.
üst
4140fb52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
stdtypes.rst
Doc/library/stdtypes.rst
+17
-5
No files found.
Doc/library/stdtypes.rst
Dosyayı görüntüle @
bebe91a0
...
@@ -1526,11 +1526,23 @@ expression support in the :mod:`re` module).
...
@@ -1526,11 +1526,23 @@ expression support in the :mod:`re` module).
.. method:: str.expandtabs([tabsize])
.. method:: str.expandtabs([tabsize])
Return a copy of the string where all tab characters are replaced by zero or
Return a copy of the string where all tab characters are replaced by one or
more spaces, depending on the current column and the given tab size. The
more spaces, depending on the current column and the given tab size. Tab
column number is reset to zero after each newline occurring in the string.
positions occur every *tabsize* characters (default is 8, giving tab
If *tabsize* is not given, a tab size of ``8`` characters is assumed. This
positions at columns 0, 8, 16 and so on). To expand the string, the current
doesn't understand other non-printing characters or escape sequences.
column is set to zero and the string is examined character by character. If
the character is a tab (``\t``), one or more space characters are inserted
in the result until the current column is equal to the next tab position.
(The tab character itself is not copied.) If the character is a newline
(``\n``) or return (``\r``), it is copied and the current column is reset to
zero. Any other character is copied unchanged and the current column is
incremented by one regardless of how the character is represented when
printed.
>>> '01\t012\t0123\t01234'.expandtabs()
'01 012 0123 01234'
>>> '01\t012\t0123\t01234'.expandtabs(4)
'01 012 0123 01234'
.. method:: str.find(sub[, start[, end]])
.. method:: str.find(sub[, start[, end]])
...
...
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