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
b30d0164
Kaydet (Commit)
b30d0164
authored
Mar 10, 1998
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Logical markup.
üst
4ef33292
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
50 deletions
+52
-50
libgzip.tex
Doc/lib/libgzip.tex
+26
-25
libgzip.tex
Doc/libgzip.tex
+26
-25
No files found.
Doc/lib/libgzip.tex
Dosyayı görüntüle @
b30d0164
\section
{
Built-in
Module
\sectcode
{
gzip
}}
\section
{
Standard
Module
\sectcode
{
gzip
}}
\label
{
module-gzip
}
\
bi
modindex
{
gzip
}
\
st
modindex
{
gzip
}
The data compression provided by the
\code
{
zlib
}
module is compatible
with that used by the GNU compression program
\file
{
gzip
}
.
Accordingly, the
\code
{
gzip
}
module provides the
\code
{
GzipFile
}
class
to read and write
\file
{
gzip
}
-format files, automatically compressing
or decompressing the data so it looks like an ordinary file object.
\code
{
GzipFile
}
objects simulate most of the methods of a file
object, though it's not possible to use the
\code
{
seek()
}
and
\code
{
tell()
}
methods to access the file randomly.
\setindexsubitem
{
(in module gzip)
}
\begin{funcdesc}
{
open
}{
fileobj
\optional
{
\,
filename
\optional
{
\,
mode
\,
compresslevel
}}}
Returns a new
\code
{
GzipFile
}
object on top of
\var
{
fileobj
}
, which
can be a regular file, a
\code
{
StringIO
}
object, or any object which
with that used by the GNU compression program
\program
{
gzip
}
.
Accordingly, the
\module
{
gzip
}
module provides the
\class
{
GzipFile
}
class to read and write
\program
{
gzip
}
-format files, automatically
compressing or decompressing the data so it looks like an ordinary
file object.
\class
{
GzipFile
}
objects simulate most of the methods of a file
object, though it's not possible to use the
\method
{
seek()
}
and
\method
{
tell()
}
methods to access the file randomly.
\begin{funcdesc}
{
open
}{
fileobj
\optional
{
, filename
\optional
{
, mode
\optional
{
, compresslevel
}}}}
Returns a new
\class
{
GzipFile
}
object on top of
\var
{
fileobj
}
, which
can be a regular file, a
\class
{
StringIO
}
object, or any object which
simulates a file.
The
\
file
{
gzip
}
file format includes the original filename of the
uncompressed file; when opening a
\c
ode
{
GzipFile
}
object for
The
\
program
{
gzip
}
file format includes the original filename of the
uncompressed file; when opening a
\c
lass
{
GzipFile
}
object for
writing, it can be set by the
\var
{
filename
}
argument. The default
value is an empty string.
\var
{
mode
}
can be either
\code
{
'r'
}
or
\code
{
'w'
}
depending on
whether the file will be read or written.
\var
{
compresslevel
}
is an
integer from
1 to 9 controlling the level of compression; 1 is
fastest and produces the least compression, and 9 is slowest and
produces the most compression. The default value of
\var
{
compresslevel
}
is 9
.
integer from
\code
{
1
}
to
\code
{
9
}
controlling the level of
compression;
\code
{
1
}
is fastest and produces the least compression,
and
\code
{
9
}
is slowest and produces the most compression. The
default value of
\var
{
compresslevel
}
is
\code
{
9
}
.
Calling a
\c
ode
{
GzipFile
}
object's
\code
{
close()
}
method does not
Calling a
\c
lass
{
GzipFile
}
object's
\method
{
close()
}
method does not
close
\var
{
fileobj
}
, since you might wish to append more material
after the compressed data. This also allows you to pass a
\c
ode
{
StringIO
}
object opened for writing as
\var
{
fileobj
}
, and
retrieve the resulting memory buffer using the
\c
ode
{
StringIO
}
object's
\
code
{
getvalue()
}
method.
\c
lass
{
StringIO
}
object opened for writing as
\var
{
fileobj
}
, and
retrieve the resulting memory buffer using the
\c
lass
{
StringIO
}
object's
\
method
{
getvalue()
}
method.
\end{funcdesc}
\begin{seealso}
...
...
Doc/libgzip.tex
Dosyayı görüntüle @
b30d0164
\section
{
Built-in
Module
\sectcode
{
gzip
}}
\section
{
Standard
Module
\sectcode
{
gzip
}}
\label
{
module-gzip
}
\
bi
modindex
{
gzip
}
\
st
modindex
{
gzip
}
The data compression provided by the
\code
{
zlib
}
module is compatible
with that used by the GNU compression program
\file
{
gzip
}
.
Accordingly, the
\code
{
gzip
}
module provides the
\code
{
GzipFile
}
class
to read and write
\file
{
gzip
}
-format files, automatically compressing
or decompressing the data so it looks like an ordinary file object.
\code
{
GzipFile
}
objects simulate most of the methods of a file
object, though it's not possible to use the
\code
{
seek()
}
and
\code
{
tell()
}
methods to access the file randomly.
\setindexsubitem
{
(in module gzip)
}
\begin{funcdesc}
{
open
}{
fileobj
\optional
{
\,
filename
\optional
{
\,
mode
\,
compresslevel
}}}
Returns a new
\code
{
GzipFile
}
object on top of
\var
{
fileobj
}
, which
can be a regular file, a
\code
{
StringIO
}
object, or any object which
with that used by the GNU compression program
\program
{
gzip
}
.
Accordingly, the
\module
{
gzip
}
module provides the
\class
{
GzipFile
}
class to read and write
\program
{
gzip
}
-format files, automatically
compressing or decompressing the data so it looks like an ordinary
file object.
\class
{
GzipFile
}
objects simulate most of the methods of a file
object, though it's not possible to use the
\method
{
seek()
}
and
\method
{
tell()
}
methods to access the file randomly.
\begin{funcdesc}
{
open
}{
fileobj
\optional
{
, filename
\optional
{
, mode
\optional
{
, compresslevel
}}}}
Returns a new
\class
{
GzipFile
}
object on top of
\var
{
fileobj
}
, which
can be a regular file, a
\class
{
StringIO
}
object, or any object which
simulates a file.
The
\
file
{
gzip
}
file format includes the original filename of the
uncompressed file; when opening a
\c
ode
{
GzipFile
}
object for
The
\
program
{
gzip
}
file format includes the original filename of the
uncompressed file; when opening a
\c
lass
{
GzipFile
}
object for
writing, it can be set by the
\var
{
filename
}
argument. The default
value is an empty string.
\var
{
mode
}
can be either
\code
{
'r'
}
or
\code
{
'w'
}
depending on
whether the file will be read or written.
\var
{
compresslevel
}
is an
integer from
1 to 9 controlling the level of compression; 1 is
fastest and produces the least compression, and 9 is slowest and
produces the most compression. The default value of
\var
{
compresslevel
}
is 9
.
integer from
\code
{
1
}
to
\code
{
9
}
controlling the level of
compression;
\code
{
1
}
is fastest and produces the least compression,
and
\code
{
9
}
is slowest and produces the most compression. The
default value of
\var
{
compresslevel
}
is
\code
{
9
}
.
Calling a
\c
ode
{
GzipFile
}
object's
\code
{
close()
}
method does not
Calling a
\c
lass
{
GzipFile
}
object's
\method
{
close()
}
method does not
close
\var
{
fileobj
}
, since you might wish to append more material
after the compressed data. This also allows you to pass a
\c
ode
{
StringIO
}
object opened for writing as
\var
{
fileobj
}
, and
retrieve the resulting memory buffer using the
\c
ode
{
StringIO
}
object's
\
code
{
getvalue()
}
method.
\c
lass
{
StringIO
}
object opened for writing as
\var
{
fileobj
}
, and
retrieve the resulting memory buffer using the
\c
lass
{
StringIO
}
object's
\
method
{
getvalue()
}
method.
\end{funcdesc}
\begin{seealso}
...
...
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