@@ -56,3 +56,17 @@ def main():
if __name__ == '__main__':
main()
+
+### OUTPUT ###
+# PRODUCT LIST:
+# eggs
+# milk
+# cheese
+#
+# PRODUCT INFORMATION:
+# Name: Cheese, Price: 2.00, Quantity: 10
+# Name: Eggs, Price: 0.20, Quantity: 100
+# Name: Milk, Price: 1.50, Quantity: 10
+# That product "arepas" does not exist in the records
@@ -76,3 +76,17 @@ if __name__ == "__main__":
shop.pet_factory = get_factory()
shop.show_pet()
print("=" * 20)
+# This is a lovely Dog
+# It says woof
+# It eats dog food
+# ====================
+# This is a lovely Cat
+# It says meow
+# It eats cat food
@@ -91,3 +91,6 @@ def main():
if __name__ == "__main__":
import doctest
doctest.testmod()
@@ -38,3 +38,14 @@ if __name__ == '__main__':
print('rm1: {0}'.format(rm1))
print('rm2: {0}'.format(rm2))
print('rm3: {0}'.format(rm3))
+# rm1: Running
+# rm2: Running
+# rm1: Zombie
+# rm2: Zombie
+# rm1 id: 139825262601040
+# rm2 id: 139825262601104
+# rm3: Zombie
@@ -46,3 +46,7 @@ def main():
+# API1.circle at 1:2 radius 7.5
+# API2.circle at 5:7 radius 27.5
@@ -68,3 +68,7 @@ if __name__ == "__main__":
director.construct_building()
building = director.get_building()
print(building)
+# Floor: One | Size: Big
+# Floor: More than One | Size: Small
@@ -58,3 +58,6 @@ def main():
+# executed method 2!
@@ -53,3 +53,14 @@ if __name__ == "__main__":
client = Client()
requests = [2, 5, 14, 22, 18, 3, 35, 27, 20]
client.delegate(requests)
+# request 2 handled in handler 1
+# request 5 handled in handler 1
+# request 14 handled in handler 2
+# request 22 handled in handler 3
+# request 18 handled in handler 2
+# request 3 handled in handler 1
+# end of chain, no handler for 35
+# request 27 handled in handler 3
+# request 20 handled in handler 2
@@ -38,3 +38,9 @@ def main():
+# renaming foo.txt to bar.txt
+# renaming bar.txt to baz.txt
+# renaming baz.txt to bar.txt
+# renaming bar.txt to foo.txt
@@ -332,3 +332,7 @@ if __name__ == "__main__":
# print(window.Frame.Button2)
print(window.Frame.Button1.label)
print(window.Frame.Button2.label)
+# Submit
+# Browse
@@ -45,3 +45,8 @@ def main():
+# decorated f1
+# original f1
+# original f2
@@ -61,3 +61,23 @@ class TestRunner:
testrunner = TestRunner()
testrunner.runAll()
+# ###### In Test 1 ######
+# Setting up
+# Running test
+# Tearing down
+# Test Finished
+# ###### In Test 2 ######
+# ###### In Test 3 ######
@@ -33,3 +33,9 @@ e, g = get_localizer("English"), get_localizer("Greek")
# Localize some text
for msgid in "dog parrot cat bear".split():
print(e.get(msgid), g.get(msgid))
+# dog σκύλος
+# parrot parrot
+# cat γάτα
+# bear bear
@@ -34,3 +34,8 @@ if __name__ == '__main__':
print(c1, c2)
print(c1 == c2)
print(id(c1), id(c2))
+# <Card: 9h> <Card: 9h>
+# True
+# 140368617673296 140368617673296
@@ -78,3 +78,8 @@ graph1 = GraphSearch(graph)
print(graph1.find_path('A', 'D'))
print(graph1.find_all_path('A', 'D'))
print(graph1.find_shortest_path('A', 'D'))
+# ['A', 'B', 'C', 'D']
+# [['A', 'B', 'C', 'D']]
@@ -29,3 +29,9 @@ for number in count_to_five():
print(number, end=' ')
print()
+# Counting to two...
+# one two
+# Counting to five...
+# one two three four five
@@ -118,3 +118,22 @@ if __name__ == '__main__':
tc.setup()
tc.execute()
tc.tearDown()
+# Setting up the Test
+# Inserting the execution begin status in the Database
+# Executing the test
+# Updating the test results in Database
+# Reporting the results of Test
+# Reporter Class is preparing to report the results
+# Problem in setup. Test not executed.
+# Test not executed. No tear down required.
@@ -95,3 +95,28 @@ if __name__ == '__main__':
traceback.print_exc(file=sys.stdout)
pass
print(n)
+# <NumObj: -1>
+# <NumObj: 0>
+# <NumObj: 1>
+# <NumObj: 2>
+# -- commited
+# <NumObj: 3>
+# <NumObj: 4>
+# <NumObj: 5>
+# -- rolled back
+# -- now doing stuff ...
+# -> doing stuff failed!
+# Traceback (most recent call last):
+# File "memento.py", line 91, in <module>
+# n.DoStuff()
+# File "memento.py", line 47, in transaction
+# return self.method(obj, *args, **kwargs)
+# File "memento.py", line 67, in DoStuff
+# self.Increment() # <- will fail and rollback
+# File "memento.py", line 62, in Increment
+# self.value += 1
+# TypeError: Can't convert 'int' object to str implicitly
@@ -55,3 +55,20 @@ if __name__ == '__main__':
controller.get_product_information('eggs')
controller.get_product_information('milk')
controller.get_product_information('arepas')
@@ -80,3 +80,10 @@ def test():
test()
+# Null
+# attr1 Null
@@ -83,3 +83,22 @@ def main():
+# Setting Data 1 = 10
+# DecimalViewer: Subject Data 1 has data 10
+# HexViewer: Subject Data 1 has data 0xa
+# Setting Data 2 = 15
+# HexViewer: Subject Data 2 has data 0xf
+# DecimalViewer: Subject Data 2 has data 15
+# Setting Data 1 = 3
+# DecimalViewer: Subject Data 1 has data 3
+# HexViewer: Subject Data 1 has data 0x3
+# Setting Data 2 = 5
+# HexViewer: Subject Data 2 has data 0x5
+# DecimalViewer: Subject Data 2 has data 5
+# Detach HexViewer from data1 and data2.
@@ -52,3 +52,9 @@ def main():
+# Inside with: yam
+# Outside with: yam
+# Inside func: sam
+# Outside func: sam
@@ -38,3 +38,7 @@ def main():
+# <__main__.main.<locals>.A object at 0x7fc1d23272d0>
+# 1 2 3
@@ -33,3 +33,9 @@ if __name__ == '__main__':
p.work()
p.busy = 'Yes'
+# Proxy checking for Sales Manager availability
+# Sales Manager ready to talk
+# Sales Manager is busy
@@ -79,3 +79,11 @@ def main():
+# jim got cartoon
+# jack got music
+# gee got movie
@@ -61,3 +61,15 @@ if __name__ == '__main__':
for action in actions:
action()
+# Scanning... Station is 1380 AM
+# Scanning... Station is 1510 AM
+# Switching to FM
+# Scanning... Station is 89.1 FM
+# Scanning... Station is 103.9 FM
+# Scanning... Station is 81.3 FM
+# Switching to AM
+# Scanning... Station is 1250 AM
@@ -41,3 +41,8 @@ if __name__ == '__main__':
strat0.execute()
strat1.execute()
strat2.execute()
+# Strategy Example 0
+# Strategy Example 1 from execute 1
+# Strategy Example 2 from execute 2
@@ -55,3 +55,53 @@ templates = [make_template(s, g, a)
# Execute them
for template in templates:
template()
+# spam
+# ----------
+# apple
+# maps
+# sgge
+# elppa
+# ['s', 'p', 'a', 'm']
+# ['e', 'g', 'g', 's']
+# ['a', 'p', 'p', 'l', 'e']
+# ['m', 'a', 'p', 's']
+# ['s', 'g', 'g', 'e']
+# ['e', 'l', 'p', 'p', 'a']
@@ -44,3 +44,8 @@ visitor = Visitor()
visitor.visit(a)
visitor.visit(b)
visitor.visit(c)
+# generic_visit A
+# visit_B B
+# visit_B C