diff options
author | San Jacobs | 2020-08-23 23:40:22 +0200 |
---|---|---|
committer | San Jacobs | 2020-08-23 23:40:22 +0200 |
commit | aa952590639e7e694ed24e673368d55eaea700f8 (patch) | |
tree | b9a350af399e0addf3b013145fd1f1ff4cd66b38 /filmstripper.py | |
parent | e2f988d1dec469beff8d55e8ebff00b82264853b (diff) | |
download | filmstripper-aa952590639e7e694ed24e673368d55eaea700f8.tar.gz filmstripper-aa952590639e7e694ed24e673368d55eaea700f8.tar.bz2 filmstripper-aa952590639e7e694ed24e673368d55eaea700f8.zip |
Made O/C/U choice mandatory
Diffstat (limited to 'filmstripper.py')
-rw-r--r-- | filmstripper.py | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/filmstripper.py b/filmstripper.py index 98a16fc..e36c3a3 100644 --- a/filmstripper.py +++ b/filmstripper.py @@ -43,18 +43,25 @@ else: outputFile = "output/output.png" if path.isfile(outputFile): - print("WARNING: Output file already exists. What would you like to do? Overwrite, Cancel or Unique?") - answer = input("[O/C/U]: ") - if answer == "O" or answer == "o": - None - elif answer == "C" or answer == "c": - broke = True - elif answer == "U" or answer == "u": - while path.isfile(outputFile): - index = outputFile.find(".") - newName = outputFile[:index] + str(random.randint(0, 9)) + outputFile[index:] - print("New output filename: "+newName) - outputFile = newName + name_conflict = True + while name_conflict: + print("WARNING: Output file already exists. What would you like to do? Overwrite, Cancel or Unique?") + answer = input("[O/C/U]: ") + if answer == "O" or answer == "o": + None + name_conflict = False + elif answer == "C" or answer == "c": + broke = True + name_conflict = False + elif answer == "U" or answer == "u": + while path.isfile(outputFile): + index = outputFile.find(".") + newName = outputFile[:index] + str(random.randint(0, 9)) + outputFile[index:] + print("New output filename: "+newName) + outputFile = newName + name_conflict = False + else: + print("Please write O, C or U.") brkck() |