From cee3e2d1c7db5bb341bb73af4fda5566bd63870b Mon Sep 17 00:00:00 2001 From: San Jacobs Date: Tue, 12 May 2020 16:52:14 +0200 Subject: Added default directories Added input/ as default input folder and output/output.png as default output location. --- filmstripper.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'filmstripper.py') diff --git a/filmstripper.py b/filmstripper.py index 2b2fa21..73527dc 100644 --- a/filmstripper.py +++ b/filmstripper.py @@ -19,23 +19,27 @@ def brkck(**args): # Reading the input arguments -try: - print("Reading input folder...") - inputFolder = sys.argv[1] - print(inputFolder) -except: - print("ERROR: Input folder argument invalid.") - broke = True +if len(sys.argv) > 2: + try: + print("Reading input folder...") + inputFolder = sys.argv[1] + print(inputFolder) + except: + print("ERROR: Input folder argument invalid.") + broke = True -brkck() + brkck() -try: - print("Reading output filename...") - outputFile = sys.argv[2] - print(outputFile) -except: - print("ERROR: Output file argument invalid.") - broke = True + try: + print("Reading output filename...") + outputFile = sys.argv[2] + print(outputFile) + except: + print("ERROR: Output file argument invalid.") + broke = True +else: + inputFolder = "input/" + outputFile = "output/output.png" if path.isfile(outputFile): print("WARNING: Output file already exists. What would you like to do? Overwrite, Cancel or Unique?") -- cgit v1.2.1