I'm trying to write a python script that runs from command arguments if the value is not present it should be set to default (or False) and the code should run without failure. here is an example of what I'm trying to perform.
config = sys.argv[1]
val = sys.argv[2]
if (val):
for i in list:
print(i)
else:
print("don't do anything")
I'm running my code like this: python3 test.py config/json TEST=True I want to run the above code if will not provide the TEST value then TEST should be considered False.
any pointer would be really appreciated.