Skip to content

Commit f61504c

Browse files
committed
Add output to bottom of scripts
1 parent ec8d735 commit f61504c

29 files changed

+304
-0
lines changed

3-tier.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,17 @@ def main():
5656

5757
if __name__ == '__main__':
5858
main()
59+
60+
### OUTPUT ###
61+
# PRODUCT LIST:
62+
# eggs
63+
# milk
64+
# cheese
65+
#
66+
# PRODUCT INFORMATION:
67+
# Name: Cheese, Price: 2.00, Quantity: 10
68+
# PRODUCT INFORMATION:
69+
# Name: Eggs, Price: 0.20, Quantity: 100
70+
# PRODUCT INFORMATION:
71+
# Name: Milk, Price: 1.50, Quantity: 10
72+
# That product "arepas" does not exist in the records

abstract_factory.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,17 @@ def get_factory():
7676
shop.pet_factory = get_factory()
7777
shop.show_pet()
7878
print("=" * 20)
79+
80+
### OUTPUT ###
81+
# This is a lovely Dog
82+
# It says woof
83+
# It eats dog food
84+
# ====================
85+
# This is a lovely Cat
86+
# It says meow
87+
# It eats cat food
88+
# ====================
89+
# This is a lovely Dog
90+
# It says woof
91+
# It eats dog food
92+
# ====================

adapter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@ def main():
9191
if __name__ == "__main__":
9292
import doctest
9393
doctest.testmod()
94+
95+
### OUTPUT ###
96+

borg.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,14 @@ class YourBorg(Borg):
3838
print('rm1: {0}'.format(rm1))
3939
print('rm2: {0}'.format(rm2))
4040
print('rm3: {0}'.format(rm3))
41+
42+
### OUTPUT ###
43+
# rm1: Running
44+
# rm2: Running
45+
# rm1: Zombie
46+
# rm2: Zombie
47+
# rm1 id: 139825262601040
48+
# rm2 id: 139825262601104
49+
# rm1: Zombie
50+
# rm2: Zombie
51+
# rm3: Zombie

bridge.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ def main():
4646

4747
if __name__ == '__main__':
4848
main()
49+
50+
### OUTPUT ###
51+
# API1.circle at 1:2 radius 7.5
52+
# API2.circle at 5:7 radius 27.5

builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,7 @@ def __repr__(self):
6868
director.construct_building()
6969
building = director.get_building()
7070
print(building)
71+
72+
### OUTPUT ###
73+
# Floor: One | Size: Big
74+
# Floor: More than One | Size: Small

catalog.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ def main():
5858

5959
if __name__ == "__main__":
6060
main()
61+
62+
### OUTPUT ###
63+
# executed method 2!

chain.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,14 @@ def delegate(self, requests):
5353
client = Client()
5454
requests = [2, 5, 14, 22, 18, 3, 35, 27, 20]
5555
client.delegate(requests)
56+
57+
### OUTPUT ###
58+
# request 2 handled in handler 1
59+
# request 5 handled in handler 1
60+
# request 14 handled in handler 2
61+
# request 22 handled in handler 3
62+
# request 18 handled in handler 2
63+
# request 3 handled in handler 1
64+
# end of chain, no handler for 35
65+
# request 27 handled in handler 3
66+
# request 20 handled in handler 2

command.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@ def main():
3838

3939
if __name__ == "__main__":
4040
main()
41+
42+
### OUTPUT ###
43+
# renaming foo.txt to bar.txt
44+
# renaming bar.txt to baz.txt
45+
# renaming baz.txt to bar.txt
46+
# renaming bar.txt to foo.txt

composite.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,7 @@ def addChild2(self, child):
332332
# print(window.Frame.Button2)
333333
print(window.Frame.Button1.label)
334334
print(window.Frame.Button2.label)
335+
336+
### OUTPUT ###
337+
# Submit
338+
# Browse

0 commit comments

Comments
 (0)