-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (22 loc) · 848 Bytes
/
main.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/bin/env python 可以让这个py文件直接在Unix/Linux/Mac上运行
# -*- coding: utf-8 -*- 使用标准UTF-8编码;
# ' main entry point ' #表示模块的文档注释
import argparse
# import pretty_errors
from autopy.core.App import App
from autopy.core.Option import Option
__author__ = 'Song Hui' # 作者名
def get_options_from_command_line():
# Initialize parser
parser = argparse.ArgumentParser()
# Adding optional argument
parser.add_argument("-p", "--project", help="Use specified project file")
# Read arguments from command line
args = parser.parse_args()
if args:
print("parsing arguments: {}".format(args))
return Option(args.project)
if __name__ == '__main__':
option = get_options_from_command_line()
app = App(option)
app.execute()