Created
March 7, 2019 11:54
-
-
Save luizhenriquefbb/ff3ca5a26bb7fd39633fce58d8c5cc22 to your computer and use it in GitHub Desktop.
exemplo de arg parse em python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
if __name__ == '__main__': | |
# construct the argument parser and parse the arguments | |
ap = argparse.ArgumentParser() | |
ap.add_argument("-i", "--image", required=False, | |
help="Path to the image to be scanned") | |
args = vars(ap.parse_args()) | |
if args["image"] == None: | |
image1 = "../testeCases/unknown/f.png" | |
else: | |
# load the image and compute the ratio of the old height | |
# to the new height, clone it, and resize it | |
image1 = args["image"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment