mirror of
https://github.com/Xevion/sharex-quickzoom.git
synced 2025-12-06 01:16:15 -06:00
16 lines
469 B
Python
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) |