Created
March 2, 2018 12:29
-
-
Save dpineiden/fb8e303f8a24694d96c7a5ec69d21851 to your computer and use it in GitHub Desktop.
Argparse example
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 | |
parser=argparse.ArgumentParser(description="Obtener parámetros de operación") | |
parser.add_argument('--group', | |
type=int, | |
help="Select the group of stations {0,1,2,3}", | |
choices=[0,1,2,3]) | |
parser.add_argument('--workers', | |
type=int, | |
help="Select amount of workers to run with") | |
parser.add_argument('--eXw', | |
type=int, | |
help="Amount of stations by workers, to get data and process") | |
if __name__ == "__main__": | |
args=parser.parse_args() | |
workers=nproc | |
if args.workers: | |
workers=args.workers | |
est_by_proc=GUI_STATIONS_BY_WORKER | |
group=GROUP | |
if args.group: | |
group=st_dict[args.group] | |
if args.eXw: | |
est_by_proc=args.eXw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment