>>> %Run L22B.py >>> %Run L22B.py >>> c1 = Customer('Jason','Grant',1) >>> c1.deposit(100) >>> %Run L22B.py >>> c1 = Customer('Jason','Grant',1) >>> c1.deposit(100) >>> print(c1) Jason Grant: 100.0 >>> c1._balance += 1000 >>> c1 <__main__.Customer object at 0x101bc6eb8> >>> print(c1) Jason Grant: 1100.0 >>> %Run L22B.py >>> %Run L22B.py >>> bank = Bank('cs101') >>> c1 = Customer('Jason','Grant',1) >>> c1.deposit(100) >>> %Run L22B.py >>> Simulation() Traceback (most recent call last): File "", line 1, in File "/Users/jgrant/class/sp.2018/cs101/class/L22B.py", line 69, in Simulation bank.addCustomer(c1) File "/Users/jgrant/class/sp.2018/cs101/class/L22B.py", line 61, in addCustomer self.customers[customers.id] = customer NameError: name 'customers' is not defined >>> %Run L22B.py >>> Simulation() >>> %Run L22B.py >>> %Run L22B.py >>> Simulation() >>> c1 = Customer('a','b',1) >>> c1.deposit(5) >>> print(c1) a b: 5.0 >>> c2 = c1 >>> print(c2) a b: 5.0 >>> c1.deposit(10) >>> print(c1) a b: 15.0 >>> print(c2) a b: 15.0 >>> import copy >>> c3 = copy.copy(c1) >>> print(c1) a b: 15.0 >>> print(c2) a b: 15.0 >>> print(c3) a b: 15.0 >>> c1.depost(100) Traceback (most recent call last): File "", line 1, in AttributeError: 'Customer' object has no attribute 'depost' >>> c1.deposit(100) >>> print(c1) a b: 115.0 >>> print(c2) a b: 115.0 >>> print(c3) a b: 15.0 >>> %Run l22B-py.py File "/Users/jgrant/class/sp.2018/cs101/class/l22B-py.py", line 5 ^ SyntaxError: unexpected EOF while parsing >>> %Run l22B-py.py >>> %Run l22B-py.py >>> %Run l22B-py.py >>> DrawSomething() >>> %Run l22B-py.py >>> DrawSomething() >>> %Run l22B-py.py >>> DrawSomething() Thonny internal error: Traceback (most recent call last): File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 582, in execute_source value = eval(bytecode, global_vars) File "", line 1, in File "/Users/jgrant/class/sp.2018/cs101/class/l22B-py.py", line 9, in DrawSomething run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyprocessing/__init__.py", line 434, in run pyglet.app.run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/__init__.py", line 138, in run event_loop.run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/base.py", line 142, in run self._run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/base.py", line 155, in _run platform_event_loop.step(timeout) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/cocoa.py", line 146, in step NSAnyEventMask, timeout_date, NSDefaultRunLoopMode, True) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 785, in __call__ return self.method(self.objc_id, *args) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 755, in __call__ result = f(objc_id, self.selector, *args) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 133, in signal_handler raise KeyboardInterrupt("Execution interrupted") KeyboardInterrupt: Execution interrupted During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 119, in handle_command response = handler(cmd) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 167, in _cmd_execute_source return self._execute_source(cmd, "ToplevelResult") File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 404, in _execute_source global_vars) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 427, in _execute_source_ex global_vars) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 602, in execute_source self._print_user_exception(e_type, e_value, e_traceback) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 608, in _print_user_exception lines = traceback.format_exception(e_type, e_value, e_traceback) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 117, in format_exception type(value), value, tb, limit=limit).format(chain=chain)) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 497, in __init__ capture_locals=capture_locals) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 358, in extract f.line File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 282, in line self._line = linecache.getline(self.filename, self.lineno).strip() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/linecache.py", line 16, in getline lines = getlines(filename, module_globals) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/linecache.py", line 47, in getlines return updatecache(filename, module_globals) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/linecache.py", line 137, in updatecache lines = fp.readlines() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/../../../../../../../Python.framework/Versions/3.6/lib/python3.6/codecs.py", line 318, in decode def decode(self, input, final=False): File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/thonny/shared/thonny/backend.py", line 133, in signal_handler raise KeyboardInterrupt("Execution interrupted") KeyboardInterrupt: Execution interrupted >>> %Run l22B-py.py >>> DrawSomething() Traceback (most recent call last): File "", line 1, in File "/Users/jgrant/class/sp.2018/cs101/class/l22B-py.py", line 13, in DrawSomething run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyprocessing/__init__.py", line 434, in run pyglet.app.run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/__init__.py", line 138, in run event_loop.run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/base.py", line 142, in run self._run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/base.py", line 155, in _run platform_event_loop.step(timeout) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/cocoa.py", line 146, in step NSAnyEventMask, timeout_date, NSDefaultRunLoopMode, True) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 785, in __call__ return self.method(self.objc_id, *args) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 755, in __call__ result = f(objc_id, self.selector, *args) KeyboardInterrupt: Execution interrupted >>> %Run l22B-py.py >>> DrawSomething() Traceback (most recent call last): File "", line 1, in File "/Users/jgrant/class/sp.2018/cs101/class/l22B-py.py", line 13, in DrawSomething run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyprocessing/__init__.py", line 434, in run pyglet.app.run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/__init__.py", line 138, in run event_loop.run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/base.py", line 142, in run self._run() File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/base.py", line 155, in _run platform_event_loop.step(timeout) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/app/cocoa.py", line 146, in step NSAnyEventMask, timeout_date, NSDefaultRunLoopMode, True) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 785, in __call__ return self.method(self.objc_id, *args) File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 755, in __call__ result = f(objc_id, self.selector, *args) KeyboardInterrupt: Execution interrupted >>> %Run l22B-py.py >>> DrawSomething()