- 読み込むファイル
gzip -dc sample.txt.gz
111
222
333
sample.py
import gzip
listaddress = []
with gzip.open("sample.txt.gz", "rt") as f:
for line in f:
listaddress.append(line.replace("\n", ""))
print(listaddress)
['111', '222', '333'] #結果
Go to list of users who liked
More than 1 year has passed since last update.
import gzip
listaddress = []
with gzip.open("sample.txt.gz", "rt") as f:
for line in f:
listaddress.append(line.replace("\n", ""))
print(listaddress)
['111', '222', '333'] #結果
Register as a new user and use Qiita more conveniently
Go to list of users who liked