I am trying to pass arguments of type bool and while running the code I run python main.py --tcpip=False
. This does not work for me.
I have tried to change it to type str
and it works completely fine.
import argparse
parser = argparse.ArgumentParser(description="SSD and Gender Detection")
parser.add_argument("--tcpip",default = "True",type=str,help='transfer data via tcp/ip')
args = parser.parse_args()
print(args.tcpip)
if __name__ == '__main__':
if(args.tcpip == "True"):
send_data(count)
It prints True
even when I start the code with
python main.py --tcpip=False