Re: How to use regex (re)

2015-08-07 Thread PK Khatri
On Friday, August 7, 2015 at 9:48:35 AM UTC-7, Peter Pearson wrote: > On Thu, 6 Aug 2015 13:06:36 -0700 (PDT), PK Khatri wrote: > > I have a following script which extracts xyz.tgz and outputs to a > > folder which contains several sub-folders and files. > > > >

How to use regex (re)

2015-08-06 Thread PK Khatri
I have a following script which extracts xyz.tgz and outputs to a folder which contains several sub-folders and files. source_dir = "c:\\TEST" dest_dir = "c:\\TEST" for src_name in glob.glob(os.path.join(source_dir, '*.tgz')): base = os.path.basename(src_name) dest_na

Re: how should i add extension and unzip again?

2015-03-18 Thread PK Khatri
On Wednesday, March 18, 2015 at 4:58:34 PM UTC-7, MRAB wrote: > On 2015-03-18 23:22, PK Khatri wrote: > > This script untars .gz file to file without extension > > > > import gzip > > import glob > > import os.path > > import tarfile > >

how should i add extension and unzip again?

2015-03-18 Thread PK Khatri
This script untars .gz file to file without extension import gzip import glob import os.path import tarfile source_dir = "C:\\TEST" dest_dir = "C:\\TEST" for src_name in glob.glob(os.path.join(source_dir, '*.gz')): base = os.path.basename(src_name) dest_name = os.path.join(dest_di