Skip to content

Instantly share code, notes, and snippets.

@luizhenriquefbb
Created March 7, 2019 11:54
Show Gist options
  • Save luizhenriquefbb/ff3ca5a26bb7fd39633fce58d8c5cc22 to your computer and use it in GitHub Desktop.
Save luizhenriquefbb/ff3ca5a26bb7fd39633fce58d8c5cc22 to your computer and use it in GitHub Desktop.
exemplo de arg parse em python
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