python读取zip文件

def read_data(filename):
    """Extract the first file enclosed in a zip file as a list of words"""
    with zipfile.ZipFile(filename) as f:
        data = tf.compat.as_str(f.read(f.namelist()[0])).split()
    return data

猜你喜欢

转载自blog.csdn.net/weixin_38241876/article/details/89875124