compress

compress a string in python 3 ?

I don't understand in 2.X it worked : import zlib zlib.compress('Hello, world') now i have a : zlib.compress("Hello world!") TypeError: must be bytes or buffer, not str How can i compress my string ? Regards Bussiere ...

Needed - Visual Studio Custom Build Actions To Minify JS and CSS

I've been using Combres in my applications to compress, combine and minify my javascript and css at run time. This works extremely well and satisfies YSlow perfectly. Now I'm rethinking the whole process for performance reasons, and I'm more so thinking about doing all of this at build time instead of run time. I'm hoping that I can ge...

How do I use subprocess to tar & compress a folder?

I have used the below code, it can compress folders. But when I uncompress folders, it will throw an error. I think there is something wrong with my code. Any advice is welcome. def compress_index(): "将/var/solr/core0/data索引目录进行打包压缩至同目录下,以该日时间命名的data.tar.gz.20101013形式的压缩包" parentdirs,folder=os.path.split(g_index_path) tar_fi...

Best fit the larger image into android device?

Hi, I have a larger image of 1024 x 768. When the image is displayed in the android device as the background image then it gets compressed. Is there any way that the image can be displayed properly in all screen resolution? ...

Export to CSV and Compress with GZIP in postgres

Hello, I need to export a big table to csv file and compress it. I can export it using COPY command from postgres like - COPY foo_table to '/tmp/foo_table.csv' delimiters',' CSV HEADER; And then can compress it using gzip like - gzip -c foo_table.csv > foo.gz The problem with this approach is, I need to create this int...

c# gzipstream decompression is more like depression...

final working code is here.... public static byte[] ToGZip( this string source ) { using( var stream = new MemoryStream( ) ) { using( var compressor = new GZipStream( stream, CompressionMode.Compress ) ) { var bytes = System.Text.UTF8Encoding.UTF8.GetBytes( source ); ...