Created
May 22, 2013 22:04
-
-
Save kevinballard/5631323 to your computer and use it in GitHub Desktop.
Example script for commandr.
This file contains 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
from commandr import command, Run | |
@command('greet') | |
def Hi(name, title='Mr.', times=1): | |
'''Greet someone. | |
Arguments: | |
name - Name to greet. | |
title - Title of the person to greet. | |
times - Number of times to say the greeting. ''' | |
greeting = 'Hi %s %s!' % (title, name) | |
for _ in xrange(times): | |
print greeting | |
if __name__ == '__main__': | |
Run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment