Skip to content

Commit 9988a95

Browse files
committed
add hello module
1 parent e468f15 commit 9988a95

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

samples/module/hello.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
' a test module '
5+
6+
__author__ = 'Michael Liao'
7+
8+
import sys
9+
10+
def test():
11+
args = sys.argv
12+
if len(args)==1:
13+
print('Hello, world!')
14+
elif len(args)==2:
15+
print('Hello, %s!' % args[1])
16+
else:
17+
print('Too many arguments!')
18+
19+
if __name__=='__main__':
20+
test()
21+

0 commit comments

Comments
 (0)