mirror of
https://github.com/Xevion/sharex-quickzoom.git
synced 2025-12-14 16:12:59 -06:00
initialization
This commit is contained in:
16
main.py
Normal file
16
main.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
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)
|
||||||
Reference in New Issue
Block a user