Created
July 26, 2012 02:58
-
-
Save seanredmond/3179992 to your computer and use it in GitHub Desktop.
Trivial Python object example
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import sys | |
class Greetings(object): | |
def greet(self, recipient='World'): | |
return "Hello, %s!" % (recipient) | |
if __name__ == '__main__': | |
g = Greetings() | |
if len(sys.argv) < 2: | |
print g.greet() | |
else: | |
print g.greet(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment