title: GZip all files in a folder
body: <p>I have compiled a code that can open an .GZ file and extract that to a .txt file
  the following code works </p>
  
  <pre><code>import os       
  import gzip
  import shutil
  extension = ".gz"
  dir_name = 'C:\\test'
  dest_name= 'C:\\test\Extract'
  os.chdir(dir_name) # change directory from working dir to dir with files
  
  for item in os.listdir(dir_name): # loop through items in dir
      if item.endswith(extension): # check for ".gz" extension
           file_name = os.path.abspath(item) # get full path of files
           with gzip.open(file_name, 'rb') as f_in:
                   with open(file_name+ '.txt', 'wb') as f_out:
                       shutil.copyfileobj(f_in, f_out)
  </code></pre>
  
  <p>But the code writes in the same directory , I am not able to add the dest_name in the following line </p>
  
  <pre><code>with open(file_name+ '.txt', 'wb') as f_out:
  </code></pre>