I have a basic question about how Python(3) works.
I have a python script which I run with an argument. This argument can have a lot of different values.
This looks as follows: python script.py argument
Inside the script I have a command that looks as follows: command.a(some parameters)
.
Right now if I want to run command.b(some parameters)
or command.d(some parameters)
I need to go to the script, change the command.a
to command.b
or command.d
.
I want my script to be more flexible so if I run python script.py argument
that inside the script command.argument(some parameters)
gets executed and I no longer need to change the value myself before running it.
How would one achieve this in Python? I'm not sure if I explained this clearly.