Increment number in string

后端 未结 5 1678
孤独总比滥情好
孤独总比滥情好 2021-01-14 09:14

I am trying to get the following output until a certain condition is met.

test_1.jpg
test_2.jpg
..
test_50.jpg

The solution (if you could remotely call

5条回答
  •  滥情空心
    2021-01-14 09:47

    It seems as though your condition os.path.exists(dstPath) is matching the same renamed file multiple times. So for example, it renames test.jpg to test_1.jpg; then renames test_1.jpg to test_1_2.jpg, etc.

提交回复
热议问题