longopts, shortopts = getopt.getopt(sys.argv[1:], shortopts='', longopts=[
    'env='])
argDict = dict(longopts)
if '--env' in argDict and argDict['--env'] == 'prod':
    print('production')
else:
    print('sandbox')
Is there anyway to persuade python's getopt to handle optional parameters to options?