Hi, I was asked this by one of my friends too. There are many ways to go about doing this and I can show you how I go about doing it.
Check out the following template. It is basically a simple template which I use:
opts, args = getopt.getopt(sys.argv[1:], 'm:p:h', ['miner=', 'params=', 'help'])
for opt, arg in opts:
if opt in ('-h', '--help'):
elif opt in ('-m', '--miner'):
miner_name = arg
elif opt in ('-p', '--params'):
params = arg
Also, do note that there is no set limit on the number of parameters that you can put in to the code.
Hope this helped!