I am wanting to handle input of multiple sets of data from the command line, and I'm not sure how to do it. I am thinking that having multiple optional arguments with multiple positional arguments would work, but I don't know how to do it.
For example, I want to get data like:
{
'id': 23423423
'host': 'hostname'
'port': 234
}
I want to be able to enter multiple sets on the command line. How might I do this?
My idea was to have a command line like:
python check.py -d 23423423 hostname.com 234 -d 22332322 hostname2.com 234
I have been looking at argparse to see about how this might be done, but how this might be done is eluding me.