Created
August 18, 2022 20:24
-
-
Save knightjdr/484eb77b9bccb985692f68d0fa4fbda7 to your computer and use it in GitHub Desktop.
argparse for growth curve analysis
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 | |
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