def _available_path(folder, filename):
 path = (folder + filename)
 if (not os.path.isfile(path)):
  return path
 path += str(1)
 ct = 1
 while os.path.isfile(path):
  ct += 1
  path = ((folder + filename) + str(ct))
 return path

def _available_path ( folder , filename ) : path = ( folder + filename ) if ( not os . path . isfile ( path ) ) : return path path += str ( 1 ) ct = 1 while os . path . isfile ( path ) : ct += 1 path = ( ( folder + filename ) + str ( ct ) ) return path
takes filename and folder and returns available path .