data-maker/data/params.py

21 lines
406 B
Python
Raw Normal View History

2019-12-12 17:04:41 +00:00
import sys
2020-02-25 18:09:04 +00:00
SYS_ARGS = {}
2019-12-12 17:04:41 +00:00
if len(sys.argv) > 1:
N = len(sys.argv)
for i in range(1,N):
value = None
if sys.argv[i].startswith('--'):
key = sys.argv[i][2:] #.replace('-','')
SYS_ARGS[key] = 1
if i + 1 < N and not sys.argv[i + 1].startswith('--'):
2019-12-12 17:04:41 +00:00
value = sys.argv[i + 1] = sys.argv[i+1].strip()
else:
value = None
2019-12-12 17:04:41 +00:00
if key and value:
SYS_ARGS[key] = value
i += 2