Skip to content

Instantly share code, notes, and snippets.

@knightjdr
Created August 18, 2022 20:24
Show Gist options
  • Save knightjdr/484eb77b9bccb985692f68d0fa4fbda7 to your computer and use it in GitHub Desktop.
Save knightjdr/484eb77b9bccb985692f68d0fa4fbda7 to your computer and use it in GitHub Desktop.
argparse for growth curve analysis
import argparse
def main(dir):
print(f'I am the directory: {dir}')
def parse_args():
"""Parse command line arguments.
Returns:
dict: The parsed arguments.
"""
parser = argparse.ArgumentParser(description="Perform growth curve analysis")
parser.add_argument(
"-d",
"--dir",
help="The directory where analysis files are stored and where output will be written",
required=True,
type=str,
)
args = vars(parser.parse_args())
return args
if __name__ == "__main__":
main(**parse_args())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment