你可以使用下面的示例代码来解压缩gzip压缩的变量:import gzipwith gzip.open('variable.gz', 'rb') as f: file_content = f.read()