def complete_filename(text):
 list = glob.glob((text + '*'))
 for (idx, val) in enumerate(list):
  if os.path.isdir(val):
   list[idx] = (val + os.path.sep)
 return list

def complete_filename ( text ) : list = glob . glob ( ( text + '*' ) ) for ( idx , val ) in enumerate ( list ) : if os . path . isdir ( val ) : list [ idx ] = ( val + os . path . sep ) return list
complete a filename .