Created
June 9, 2012 03:12
-
-
Save shimizukawa/2899220 to your computer and use it in GitHub Desktop.
clime sample code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo(name, age=10): | |
print "{0} is {1} years old.".format(name, age) | |
import clime.now # this NEED to place here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(env1) D:\env1>python foo.py | |
foo.py: foo() takes at least 1 argument (1 given) | |
(env1) D:\env1>python foo.py --help | |
usage: [--age] NAME | |
or: foo [--age] NAME | |
(env1) D:\env1>python foo.py xaxtsuxo | |
xaxtsuxo is 10 years old. | |
(env1) D:\env1>python foo.py --age 90 | |
foo.py: foo() takes at least 1 argument (1 given) | |
(env1) D:\env1>python foo.py xaxtsuxo --age 90 | |
xaxtsuxo is 90 years old. | |
(env1) D:\env1>python foo.py foo --age 90 | |
foo.py: foo() takes at least 1 argument (1 given) | |
(env1) D:\env1>python foo.py foo bar --age 90 | |
bar is 90 years old. | |
(env1) D:\env1>python foo.py bar --age 90 | |
bar is 90 years old. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment