Files
sharex-quickzoom/main.py
2019-08-03 19:26:09 -05:00

16 lines
469 B
Python

import os, sys, time, argparse
# Simple tester for testing whether a file exists.
# StackOverflow https://stackoverflow.com/a/51212150/6912830
def file_path(string):
if os.path.isfile(string):
return string
else:
raise NotADirectoryError(string)
# Argparser
parser = argparse.ArgumentParser()
parser.add_argument('path', metavar='PATH', type=file_path, help='the full path to the file in question')
args = parser.parse_args()
print(args.path)