-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_template.py
32 lines (22 loc) · 932 Bytes
/
script_template.py
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
27
28
29
30
31
32
#!/usr/local/bin/python3
"""
Add program description here.
"""
import argparse
import subprocess
from pathlib import Path
def get_args():
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=__doc__)
parser.add_argument('-i', '--input', type=Path, action='store', dest='input_dir', metavar='INPUT_DIR',
help='Path to input BIDS directory.')
parser.add_argument('-o', '--output', type=Path, action='store', dest='output_dir', metavar='OUTPUT_DIR',
default=Path('.'), help="Path to directory that'll contain the outputs.")
args = parser.parse_args()
return args.inputdir.resolve(), args.outdir.resolve()
def run(cmdstr):
p = subprocess.run(cmdstr, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf8', shell=True)
return p.stdout
def main():
return None
if __name__ == "__main__":
main()