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
0692a262
Kaydet (Commit)
0692a262
authored
Mar 13, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1679379: add documentation for fnmatch.translate().
üst
3bb15672
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
libfnmatch.tex
Doc/lib/libfnmatch.tex
+31
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Doc/lib/libfnmatch.tex
Dosyayı görüntüle @
0692a262
...
...
@@ -36,6 +36,19 @@ lower- or upper-case before the comparison is performed. If you
require a case-sensitive comparison regardless of whether that's
standard for your operating system, use
\function
{
fnmatchcase()
}
instead.
This example will print all file names in the current directory with the
extension
\code
{
.txt
}
:
\begin{verbatim}
import fnmatch
import os
for file in os.listdir('.'):
if fnmatch.fnmatch(file, '*.txt'):
print file
\end{verbatim}
\end{funcdesc}
\begin{funcdesc}
{
fnmatchcase
}{
filename, pattern
}
...
...
@@ -50,6 +63,24 @@ implemented more efficiently.
\versionadded
{
2.2
}
\end{funcdesc}
\begin{funcdesc}
{
translate
}{
pattern
}
Return the shell-style
\var
{
pattern
}
converted to a regular
expression.
Example:
\begin{verbatim}
>>> import fnmatch, re
>>>
>>> regex = fnmatch.translate('*.txt')
>>> regex
'.*
\\
.txt
$
'
>>> reobj
=
re.compile
(
regex
)
>>> print reobj.match
(
'foobar.txt'
)
<
_
sre.SRE
_
Match object at
0
x...>
\end
{
verbatim
}
\end
{
funcdesc
}
\begin
{
seealso
}
\seemodule
{
glob
}{
\UNIX
{}
shell
-
style path expansion.
}
\end
{
seealso
}
Misc/NEWS
Dosyayı görüntüle @
0692a262
...
...
@@ -594,6 +594,8 @@ Tools
Documentation
-------------
- Patch #1679379: add documentation for fnmatch.translate().
- Bug #1629566: clarify the docs on the return values of parsedate()
and parsedate_tz() in email.utils and rfc822.
...
...
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