匿名用户
1级
2017-06-18 回答
python test.py --input1 dat1.txt --input2 dat2.txt > 2.out.txt
复制代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'shengwei ma'
__author_email__ = 'shengweima@icloud.com'
import sys
import getopt
input_file1 = ""
input_file2 = ""
try:
opts, args = getopt.getopt(sys.argv[1:], "h", ["input1=", "input2="])
except getopt.GetoptError as err:
print(str(err))
for op, value in opts:
if op == "--input1":
input_file1 = value
elif op == "--input2":
input_file2 = value
elif op == "-h":
print("python get_value_according_first_column.py --input1 dat1 --input2 dat2 > out.txt