How to decompress text in Python that has been compressed with gzip?
问题 How can you decompress a string of text in Python 3, that has been compressed with gzip and converted to base 64? For example, the text: EgAAAB+LCAAAAAAABAALycgsVgCi4vzcVAWFktSKEgC9n1/fEgAAAA== Should convert to: This is some text The following C# code successfully does this: var gzBuffer = Convert.FromBase64String(compressedText); using (var ms = new MemoryStream()) { int msgLength = BitConverter.ToInt32(gzBuffer, 0); ms.Write(gzBuffer, 4, gzBuffer.Length - 4); var buffer = new byte