SZI2019SmieciarzWmi/utils.py

15 lines
358 B
Python
Raw Normal View History

import sys, getopt
def set_home_amount():
arguments = sys.argv[1:]
try:
optlist, args = getopt.getopt(arguments, '', ['home-count='])
for o, amount in optlist:
if o == '--home-count':
return int(amount)
print('missing argument: --home-count <amount>')
sys.exit(2)
except getopt.GetoptError as err:
print(err)
sys.exit(2)