-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest_option.py
More file actions
34 lines (28 loc) · 1.24 KB
/
Test_option.py
File metadata and controls
34 lines (28 loc) · 1.24 KB
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
33
34
from optparse import OptionParser
import sys
def main():
parser = OptionParser(usage="usage: %prog -i <story_header.csv> -s <story_header_sell_all.csv>",
version="%prog 1.0")
parser.add_option("-i", "--input",
action="store",
dest="inputfile",
type="string",
help="Filename of story_header -- type(csv)")
parser.add_option("-s", "--sell",
action="store", # optional because action defaults to "store"
dest="inputfile_seller",
type="string",
help="Filename of story_header_sell_all -- type(csv)")
parser.add_option("-o", "--output",
action="store", # optional because action defaults to "store"
dest="outputfile",
type="string",
help="[Optional] Set output filename -- type(csv)")
(options, args) = parser.parse_args()
if options.inputfile is None or options.inputfile_seller is None:
print("Type input Filename of stroy_header and story_header_sell_all")
sys.exit(0)
else:
print(options)
if __name__ == '__main__':
main()