diff --git a/random_file_move.py b/random_file_move.py index 304a5861933..9e735bbc2a7 100644 --- a/random_file_move.py +++ b/random_file_move.py @@ -15,7 +15,7 @@ def check_ratio(x): except ValueError: raise argparse.ArgumentTypeError("%r not a floating-point literal" % (x,)) - if x < 0.0 or x > 1.0: + if (x < 0.0 or x > 1.0): raise argparse.ArgumentTypeError("%r not in range [0.0, 1.0]" % (x)) return x @@ -37,7 +37,7 @@ def check_ratio(x): ratio = args.ratio files = os.listdir(src) -size = int(ratio*len(files)) +size = int(ratio * len(files)) print('Move {} files from {} to {} ? [y/n]'.format(size, src, dest)) if input().lower() == 'y': @@ -48,4 +48,4 @@ def check_ratio(x): print(e) print('Successful') else: - print('Cancelled') \ No newline at end of file + print('Cancelled')