old_contents: #!/usr/bin/python
  
  import sys, os
  
  import mmap  # Thanks Steven @ http://stackoverflow.com/questions/4940032/search-for-string-in-txt-file-python
  
  import subprocess
  
  import readline
  
  readline.set_completer_delims(' \t\n;')
  readline.parse_and_bind("tab: complete")
  readline.parse_and_bind("set match-hidden-files off")
  
  import re
  
  import argparse
  
  def query(question, default):
      sys.stdout.write(question + " [" + default + "] ? ")
      choice = raw_input()
      if choice == '':
          return default
      return choice
  
  if __name__ == '__main__':
  
      print("-------------------------------")
      print("Welcome to song-directory-strip")
      print("-------------------------------")
  
      parser = argparse.ArgumentParser()
      parser.add_argument('--input',
                          help='specify the path of the default song (input) directory',
                          default='/home/yo/Dropbox/chords/0-GUITAR/english')
      parser.add_argument('--output',
                          help='specify the path of the default song (output) directory',
                          default='tmp')
      args = parser.parse_args()
  
      # Query the path of the song (input) directory
      inputDirectory = query("Please specify the path of the song (input) directory", args.input)
      print("Will use song (input) directory: " + inputDirectory)
  
      # Query the path of the song (output) directory
      outputDirectory = query("Please specify the path of the song (output) directory", args.output)
  
      if os.path.isdir(outputDirectory):
          yesNo = query('Path "' + outputDirectory + '" already exists, are you sure (confirm with "y" or "yes" without quotes)', 'yes')
          if yesNo != "yes" and yesNo != "y":
              print "Ok, bye!"
              quit()
          else:
              print("Will use (existing) song (output) directory: " + outputDirectory)
      else:
          os.makedirs(outputDirectory)
          print("Will use (newly created) song (output) directory: " + outputDirectory)
  
      print("----------------------")
  
      #sys.stdout.write(s)  #-- Screen output for debugging.
  
      rep = ""
      for dirname, dirnames, filenames in os.walk(inputDirectory):
          for filename in sorted(filenames):
              #debug
              print filename
              songIn = open( os.path.join(dirname, filename) )
              songOut = open(os.path.join(outputDirectory, filename), "w")
              contents = songIn.read()
              contents = re.sub("\([^)]*\)", '', contents)
              songOut.write(contents)
              songOut.close()
              songIn.close()
  
new_contents: #!/usr/bin/env python
  
  import sys, os
  
  import mmap  # Thanks Steven @ http://stackoverflow.com/questions/4940032/search-for-string-in-txt-file-python
  
  import subprocess
  
  import readline
  
  readline.set_completer_delims(' \t\n;')
  readline.parse_and_bind("tab: complete")
  readline.parse_and_bind("set match-hidden-files off")
  
  import re
  
  import argparse
  
  def query(question, default):
      sys.stdout.write(question + " [" + default + "] ? ")
      choice = raw_input()
      if choice == '':
          return default
      return choice
  
  if __name__ == '__main__':
  
      print("-------------------------------")
      print("Welcome to song-directory-strip")
      print("-------------------------------")
  
      parser = argparse.ArgumentParser()
      parser.add_argument('--input',
                          help='specify the path of the default song (input) directory',
                          default='/home/yo/Dropbox/chords/0-GUITAR/english')
      parser.add_argument('--output',
                          help='specify the path of the default song (output) directory',
                          default='tmp')
      args = parser.parse_args()
  
      # Query the path of the song (input) directory
      inputDirectory = query("Please specify the path of the song (input) directory", args.input)
      print("Will use song (input) directory: " + inputDirectory)
  
      # Query the path of the song (output) directory
      outputDirectory = query("Please specify the path of the song (output) directory", args.output)
  
      if os.path.isdir(outputDirectory):
          yesNo = query('Path "' + outputDirectory + '" already exists, are you sure (confirm with "y" or "yes" without quotes)', 'yes')
          if yesNo != "yes" and yesNo != "y":
              print "Ok, bye!"
              quit()
          else:
              print("Will use (existing) song (output) directory: " + outputDirectory)
      else:
          os.makedirs(outputDirectory)
          print("Will use (newly created) song (output) directory: " + outputDirectory)
  
      print("----------------------")
  
      #sys.stdout.write(s)  #-- Screen output for debugging.
  
      rep = ""
      for dirname, dirnames, filenames in os.walk(inputDirectory):
          for filename in sorted(filenames):
              #debug
              print filename
              songIn = open( os.path.join(dirname, filename) )
              songOut = open(os.path.join(outputDirectory, filename), "w")
              contents = songIn.read()
              contents = re.sub("\([^)]*\)", '', contents)
              songOut.write(contents)
              songOut.close()
              songIn.close()
  
subject: update shebang