Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 5f31e68

Browse files
committed
Add argument option.
1 parent 4f492f3 commit 5f31e68

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

run.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/evn python3
22

3-
import Mykytea
43
import re
4+
import sys
5+
6+
import Mykytea
57

68

7-
def get_mk():
8-
opt = ''
9+
def get_mk(opt=''):
910
mk = Mykytea.Mykytea(opt)
1011
return mk
1112

@@ -16,7 +17,10 @@ def get_kytea_txt(mk, txt):
1617
return n_txt
1718

1819
if __name__ == '__main__':
19-
mk = get_mk()
20+
if len(sys.argv) != 1:
21+
mk = get_mk(' '.join(sys.argv[1:]))
22+
else:
23+
mk = get_mk()
2024
while True:
2125
try:
2226
txt = input()

0 commit comments

Comments
 (0)