Open bruce1971 opened 2 months ago
I want you to have "type" as a command line input...
So when you run the code, the command line input should look something like... python script.py --type water
then the argument gets parsed in the script somehow like..
`import argparse
parser = argparse.ArgumentParser(description='Process some parameters.')
parser.add_argument('--type', type=str, help='Specify the type of action or item.')
args = parser.parse_args()
print(f"The specified type is: {args.type}")`
Hardcodedness fixed via your suggestion. Please check it, when you have time.
I want you to have "type" as a command line input...
So when you run the code, the command line input should look something like... python script.py --type water
then the argument gets parsed in the script somehow like..
`import argparse
Create the parser
parser = argparse.ArgumentParser(description='Process some parameters.')
Add the --type argument
parser.add_argument('--type', type=str, help='Specify the type of action or item.')
Parse the arguments
args = parser.parse_args()
Access the --type argument
print(f"The specified type is: {args.type}")`