From 64e26e695f6522aa9cf678c3308aa4de18b2fe3e Mon Sep 17 00:00:00 2001 From: neodarz Date: Mon, 10 Jul 2017 18:27:54 +0200 Subject: Add argument option for choose input folder and output folder --- convert.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/convert.py b/convert.py index ba1bc08..d700698 100755 --- a/convert.py +++ b/convert.py @@ -4,16 +4,25 @@ import sys import os import subprocess import re -#from subprocess import PIPE, CalledProcessError, check_call, Popen from subprocess import check_output, STDOUT, CalledProcessError, Popen, PIPE import pexpect import time -import progressbar +#import progressbar import datetime +if len(sys.argv) == 3: + sourcedir = sys.argv[1] + outdir = sys.argv[2] -sourcedir = "/home/neodarz/video_save/ZXAAA Demo ZX Spectrum/Cracktro" -outdir = "/home/neodarz/video_save/ZXAAA Demo ZX Spectrum_mp3/Cracktro" + if not os.path.isdir(sourcedir): + print("No such file or directory: '"+str(sourcedir)+"'") + sys.exit() +else: + print("Simple tool for convert mp4 file to mp3") + print("Usage:\nconvert.py [SOURCE] [DESTINATION]") + +#sourcedir = "/home/neodarz/video_save/ZXAAA Demo ZX Spectrum/Cracktro" +#outdir = "/home/neodarz/video_save/ZXAAA Demo ZX Spectrum_mp3/Cracktro" def dirSize(path,ext1,ext2): list_dir = [] -- cgit v1.2.1