2018-05-29から1日間の記事一覧
tarfile はZipとは違うアプローチが必要 import tarfile workpath = '/tmp/test.tgz' filename = 'test1.tsv' with tarfile.open(workpath) as tfile: if filename not in tfile.getnames(): raise Exception('No such file %s' % filename) with tfile.extr…
tarfile はZipとは違うアプローチが必要 import tarfile workpath = '/tmp/test.tgz' filename = 'test1.tsv' with tarfile.open(workpath) as tfile: if filename not in tfile.getnames(): raise Exception('No such file %s' % filename) with tfile.extr…