Add python3 class notes (#2479)

* explain that you can place the human and bat classes into seperate
files
* explain how to import specific functions from other files
This commit is contained in:
Harry Moreno 2016-10-20 17:08:44 -04:00 committed by ven
parent 1d2a910fd6
commit e68bf145bc

View File

@ -765,8 +765,13 @@ if __name__ == '__main__':
print(b.say('hello'))
print(b.fly)
# To take advantage of modularization by file you could place the classes above in their own files,
# say, human.py and bat.py
# to import functions from other files use the following format
# from "filename-without-extension" import "function-or-class"
# superhero.py
from human import Human
from bat import Bat