Skip to content

Commit 4a1dfc0

Browse files
author
xuming06
committed
use click, need update environment.
1 parent df683e3 commit 4a1dfc0

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ numpy
22
scipy
33
matplotlib
44
nltk
5-
Keras
5+
keras
66
scikit-learn
77
pypinyin
8-
tensorflow
8+
tensorflow
9+
click

tool/click_demo.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
# Author: XuMing <[email protected]>
3+
# Brief:
4+
5+
import click
6+
7+
8+
@click.command()
9+
@click.option('--count', default=1, help="num")
10+
@click.option('--rate', type=float, help='rate')
11+
@click.option('--gender', type=click.Choice(['man', 'woman']), default='man', help='select sex')
12+
@click.option('--center', type=str, nargs=2, help='center of circle')
13+
def hello(count, rate, gender, center):
14+
print("count num:", count)
15+
print("rate:", rate)
16+
print("gender:", gender)
17+
print("center:", center)
18+
19+
20+
if __name__ == "__main__":
21+
hello()

0 commit comments

Comments
 (0)