-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·26 lines (23 loc) · 754 Bytes
/
run.py
File metadata and controls
executable file
·26 lines (23 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys
import os
import shutil
import logging
logger = logging.getLogger()
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
if (len(sys.argv) < 2):
file_param = os.getcwd() + os.sep + 'example' + os.sep + 'params_example.txt'
print("no params file specified, default is " + file_param)
else:
file_param = str(sys.argv[1])
if os.path.isfile(file_param):
# basedir=os.path.dirname(swotsimulator.__file__)
shutil.copyfile(file_param, 'params.py')
# os.path.join(basedir,'params.py'))
else:
print("Error: No such file: '%s'" % file_param)
sys.exit()
import swotsimulator.run_simulator as run_simulator
run_simulator.run_simulator(file_param)