“Python membaca Zipfile” Kode Jawaban

Python membaca Zipfile

# Extract all contents from zip file
import zipfile
with zipfile.ZipFile('filename', 'r') as myzip: #'r' reads file, 'w' writes file
    myzip.extractall()
# The zipfile will be extracted and content will be available in your working
# directory.
Kwams

Ekstrak file zip di Python Zipfile

from zipfile import ZipFile
import zipfile

with ZipFile('test.zip') as myzip:
    with myzip.open('Roughwork/textfile.text') as myfile:
        print(myfile.readlines())Copy Code
Pythonist

Jawaban yang mirip dengan “Python membaca Zipfile”

Pertanyaan yang mirip dengan “Python membaca Zipfile”

Lebih banyak jawaban terkait untuk “Python membaca Zipfile” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya