diff --git a/k-teng/utility/file_io.py b/k-teng/utility/file_io.py index a16946b..710b16a 100644 --- a/k-teng/utility/file_io.py +++ b/k-teng/utility/file_io.py @@ -23,7 +23,8 @@ def get_next_filename(basename, directory=".", digits=3): for file in files: if not file.startswith(basename): continue try: - number = int(file.split('.')[0].strip(basename)) + number = file[:file.rfind('.')].replace(basename, "") + number = int(number) if number < lowest_number: continue lowest_number = number except ValueError: