Skip to content

Instantly share code, notes, and snippets.

@johnpneumann
Created November 14, 2011 18:20
Show Gist options
  • Save johnpneumann/1364673 to your computer and use it in GitHub Desktop.
Save johnpneumann/1364673 to your computer and use it in GitHub Desktop.
Class example file
#!/usr/bin/env python
def my_func(a_variable):
"""
Does stuff.
@rtype: bool
@returns: True or False.
"""
if a_variable:
print 'Your name is: %s ' % (a_variable)
else:
return False
return True
class MyClass():
"""
My Class.
"""
def __init__(self):
"""
Instantiation
"""
self.nother_func()
def nother_func(self):
"""
Passes stuff to my_func
@rtype: bool
@returns: True or False
"""
get_data = raw_input('Your name: ')
if get_data:
my_func(get_data)
else:
print 'You didn\'t enter anything!'
self.nother_func()
return True
MyClass()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment