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
177b4a06
Kaydet (Commit)
177b4a06
authored
May 22, 2002
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Jack's documentation for the U mode character on the file()
constructor, vetted by Barry.
üst
4be55b5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
libfuncs.tex
Doc/lib/libfuncs.tex
+15
-0
libstdtypes.tex
Doc/lib/libstdtypes.tex
+12
-0
No files found.
Doc/lib/libfuncs.tex
Dosyayı görüntüle @
177b4a06
...
@@ -345,6 +345,21 @@ def my_import(name):
...
@@ -345,6 +345,21 @@ def my_import(name):
that differentiate between binary and text files (else it is
that differentiate between binary and text files (else it is
ignored). If the file cannot be opened,
\exception
{
IOError
}
is
ignored). If the file cannot be opened,
\exception
{
IOError
}
is
raised.
raised.
In addition to the standard
\cfunction
{
fopen()
}
values
\var
{
mode
}
may be
\code
{
'U'
}
or
\code
{
'rU'
}
. If Python is built with universal
newline support (the default) the file is opened as a text file, but
lines may be terminated by any of
\code
{
'
\e
n'
}
, the Unix end-of-line
convention,
\code
{
'
\e
r'
}
, the Macintosh convention or
\code
{
'
\e
r
\e
n'
}
, the Windows
convention. All of these external representations are seen as
\code
{
'
\e
n'
}
by the Python program. If Python is built without universal newline support
\var
{
mode
}
\code
{
'U'
}
is the same as normal text mode. Note that
file objects so opened also have an attribute called
\member
{
newlines
}
which has a value of
\code
{
None
}
(if no newlines
have yet been seen),
\code
{
'
\e
n'
}
,
\code
{
'
\e
r'
}
,
\code
{
'
\e
r
\e
n'
}
,
or a tuple containing all the newline types seen.
If
\var
{
mode
}
is omitted, it defaults to
\code
{
'r'
}
. When opening a
If
\var
{
mode
}
is omitted, it defaults to
\code
{
'r'
}
. When opening a
binary file, you should append
\code
{
'b'
}
to the
\var
{
mode
}
value
binary file, you should append
\code
{
'b'
}
to the
\var
{
mode
}
value
...
...
Doc/lib/libstdtypes.tex
Dosyayı görüntüle @
177b4a06
...
@@ -1248,6 +1248,18 @@ file object, of the form \samp{<\mbox{\ldots}>}. This is a read-only
...
@@ -1248,6 +1248,18 @@ file object, of the form \samp{<\mbox{\ldots}>}. This is a read-only
attribute and may not be present on all file-like objects.
attribute and may not be present on all file-like objects.
\end{memberdesc}
\end{memberdesc}
\begin{memberdesc}
[file]
{
newlines
}
If Python was built with the
\code
{
--with-universal-newlines
}
option
(the default) this read-only attribute exists, and for files opened in
universal newline read mode it keeps track of the types of newlines
encountered while reading the file. The values it can take are
\code
{
'
\e
r'
}
,
\code
{
'
\e
n'
}
,
\code
{
'
\e
r
\e
n'
}
,
\code
{
None
}
(unknown,
no newlines read yet) or a tuple containing all the newline
types seen, to indicate that multiple
newline conventions were encountered. For files not opened in universal
newline read mode the value of this attribute will be
\code
{
None
}
.
\end{memberdesc}
\begin{memberdesc}
[file]
{
softspace
}
\begin{memberdesc}
[file]
{
softspace
}
Boolean that indicates whether a space character needs to be printed
Boolean that indicates whether a space character needs to be printed
before another value when using the
\keyword
{
print
}
statement.
before another value when using the
\keyword
{
print
}
statement.
...
...
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