Created
November 14, 2011 18:20
-
-
Save johnpneumann/1364673 to your computer and use it in GitHub Desktop.
Class example file
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 | |
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