I am running into a weird problem with args.parse in python 3.4 and I need some help. I am just starting with python, so it may be something stupid.
I am passing an argument
parser.add_argument('-solr', type=str, default='http://localhost:8983/solr/', nargs='+', help='Address of Solr server (ex: http://192.168.137.128:8983/solr/)')
It should be just one argument, all the time. If I actually pass the argument, it will get stored as an array and I will need to access it via args.solr[0]. However, if I don't pass any arguments to it, the default value will be used, but it will be stored as string, thus, args.solr[0] will be 'h'.
What gives? I've tried to play around with nargs, but even setting it to 1 doesn't seem to change anything.
Thanks in advance