如图,数据库里存的该格式
if __name__ == '__main__':
sql = 'select data from test where id = x'
db_connect = MySQLdb_connect()
cursor = db_connect.cursor()
cursor.execute(sql)
content = cursor.fetchone()
print content # 元组,content[0]就变成了字符串
data = gzip.decompress(content).decode("utf-8")
cursor.close()
f = open('test','w')
f.write(data)
f.close()
数据是用gzip压缩的,但是读出来不是byte格式数据、、、、求助,是不是读取方法不对