def askopenfiles(mode='r', **options):
 files = askopenfilenames(**options)
 if files:
  ofiles = []
  for filename in files:
   ofiles.append(open(filename, mode))
  files = ofiles
 return files

def askopenfiles ( mode = 'r' , ** options ) : files = askopenfilenames ( ** options ) if files : ofiles = [ ] for filename in files : ofiles . append ( open ( filename , mode ) ) files = ofiles return files
ask for multiple filenames and return the open file objects returns a list of open file objects or an empty list if cancel selected .