Skip to content

Instantly share code, notes, and snippets.

@seanredmond
Created July 26, 2012 02:58
Show Gist options
  • Save seanredmond/3179992 to your computer and use it in GitHub Desktop.
Save seanredmond/3179992 to your computer and use it in GitHub Desktop.
Trivial Python object example
#!/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