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:
import sys
import getopt
try:
opts, args = getopt.getopt(sys.argv[1:], 'm:p:h', ['miner=', 'params=', 'help'])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ('-h', '--help'):
usage()
sys.exit(2)
elif opt in ('-m', '--miner'):
miner_name = arg
elif opt in ('-p', '--params'):
params = arg
else:
usage()
sys.exit(2)
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!