python 压缩文件的几个问题

第一个问题:下面代码中的compresslevel=9是什么意思?下面代码中的compresslevel有几个取值?谢谢

 g = gzip.GzipFile(filename="", mode='wb', compresslevel=9,
                  fileobj=open("wanshe.txt.gz", 'wb'))
g.write(open('t.txt','r').read())
g.close()

第二个问题:下面代码中的w:gz是什么意思?谢谢

 tar = tarfile.open('simple.tar.gz', 'w:gz')
tar.add('simple.tar',arcname='Simple2')
tar.close()

请各位老师指点一下,谢谢

表示压缩等级 有好几个值可以查看doc文档 分别表示压缩率的不同