How to start a Python script several functions in
- by chrissygormley
Hello,
I have a Python script and I want to call it several functions down the script. Example code below:
class Name():
def __init__(self):
self.name = 'John'
self.address = 'Place'
self.age = '100'
def printName(self):
print self.name
def printAddress(self):
print self.address
def printAge(self):
print self.age
if __name__ == '__main__':
Person = Name()
Person.printName()
Person.printAddress()
Person.printage()
I execute this code by entering ./name.py. How could I exectute this code from the function printAddress() down the the end of the script?
Thanks