Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
No woman no pathlib solution in Clear category for Save File by veky
def possibilities(file):
yield file
stem, dot, suffixes = file.partition('.')
import itertools
for index in itertools.count(1):
yield stem + str(index).join('()') + dot + suffixes
def save_file(files, file):
files = frozenset(files)
for name in possibilities(file):
if name not in files: return name
March 7, 2024