sbs5@lion:~/cs200/www/lectures$ date Wed Oct 29 02:30:48 PM EDT 2025 sbs5@lion:~/cs200/www/lectures$ pwd /home/accts/sbs5/cs200/www/lectures sbs5@lion:~/cs200/www/lectures$ 1029.script 1029.script: command not found sbs5@lion:~/cs200/www/lectures$ p Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> def area_square(length): try: print(length**2) except TypeError: print("area_square only takes numbers as the argument") def area_circle(radius): try: print(3.142 * radius**2) except TypeError: print("area_circle only takes numbers as the argument") def area_rectangle(length, breadth): try: print(length * breadth) except TypeError: print("area_rectangle only takes numbers as the argument") ... ... ... ... ... >>> ... ... ... ... ... >>> ... ... ... ... ... >>> area_square(5) 25 >>> area_square('5') area_square only takes numbers as the argument >>> area_circle(10) 314.2 >>> area_circle('d') area_circle only takes numbers as the argument >>> area_rectangle(3,4) 12 >>> area_rectangle(3,'d') ddd >>> area_rectangle('d',2) dd >>> area_rectangle('d','d') area_rectangle only takes numbers as the argument >>> def exception_handler(func): def inner_function(*args, **kwargs): try: func(*args, **kwargs) except TypeError: print(f"{func.__name__} only takes numbers as the argument") return inner_functiondef exception_handler(func): def inner_function(*args, **kwargs): try: func(*args, **kwargs) except TypeError: print(f"{func.__name__} only takes numbers as the argument") return inner_function ... ... ... ... ... ... File "", line 7 return inner_functiondef exception_handler(func): ^^^^^^^^^^^^^^^^^ SyntaxError: invalid syntax >>> File "", line 1 def inner_function(*args, **kwargs): IndentationError: unexpected indent >>> File "", line 1 try: IndentationError: unexpected indent >>> File "", line 1 func(*args, **kwargs) IndentationError: unexpected indent >>> File "", line 1 except TypeError: IndentationError: unexpected indent >>> File "", line 1 print(f"{func.__name__} only takes numbers as the argument") IndentationError: unexpected indent >>> File "", line 1 return inner_function IndentationError: unexpected indent >>> def exception_handler(func): def inner_function(*args, **kwargs): try: func(*args, **kwargs) except TypeError: print(f"{func.__name__} only takes numbers as the argument") return inner_function ... ... ... ... ... ... ... >>> @exception_handler def area_square(length): print(length * length) ... ... ... >>> area_square(5) 25 >>> area_square('5') area_square only takes numbers as the argument >>> @exception_handler def area_circle(radius): print(3.14 * radius * radius) @exception_handler def area_rectangle(length, breadth): print(length * breadth) ... ... ... >>> ... ... ... >>> area_rectangle('d',2) dd >>> area_rectangle('d','f') area_rectangle only takes numbers as the argument >>> def d(): ... return 3 ... >>> d() 3 >>> sbs5@lion:~/cs200/www/lectures$ which ls /usr/bin/ls sbs5@lion:~/cs200/www/lectures$ which lex /usr/bin/lex sbs5@lion:~/cs200/www/lectures$ which flex /usr/bin/flex sbs5@lion:~/cs200/www/lectures$ lex --help Usage: lex [OPTIONS] [FILE]... Generates programs that perform pattern-matching on text. Table Compression: -Ca, --align trade off larger tables for better memory alignment -Ce, --ecs construct equivalence classes -Cf do not compress tables; use -f representation -CF do not compress tables; use -F representation -Cm, --meta-ecs construct meta-equivalence classes -Cr, --read use read() instead of stdio for scanner input -f, --full generate fast, large scanner. Same as -Cfr -F, --fast use alternate table representation. Same as -CFr -Cem default compression (same as --ecs --meta-ecs) Debugging: -d, --debug enable debug mode in scanner -b, --backup write backing-up information to lex.backup -p, --perf-report write performance report to stderr -s, --nodefault suppress default rule to ECHO unmatched text -T, --trace flex should run in trace mode -w, --nowarn do not generate warnings -v, --verbose write summary of scanner statistics to stdout --hex use hexadecimal numbers instead of octal in debug outputs Files: -o, --outfile=FILE specify output filename -S, --skel=FILE specify skeleton file -t, --stdout write scanner on stdout instead of lex.yy.c --yyclass=NAME name of C++ class --header-file=FILE create a C header file in addition to the scanner --tables-file[=FILE] write tables to FILE --backup-file=FILE write backing-up information to FILE Scanner behavior: -7, --7bit generate 7-bit scanner -8, --8bit generate 8-bit scanner -B, --batch generate batch scanner (opposite of -I) -i, --case-insensitive ignore case in patterns -l, --lex-compat maximal compatibility with original lex -X, --posix-compat maximal compatibility with POSIX lex -I, --interactive generate interactive scanner (opposite of -B) --yylineno track line count in yylineno Generated code: -+, --c++ generate C++ scanner class -Dmacro[=defn] #define macro defn (default defn is '1') -L, --noline suppress #line directives in scanner -P, --prefix=STRING use STRING as prefix instead of "yy" -R, --reentrant generate a reentrant C scanner --bison-bridge scanner for bison pure parser. --bison-locations include yylloc support. --stdinit initialize yyin/yyout to stdin/stdout --nounistd do not include --noFUNCTION do not generate a particular FUNCTION Miscellaneous: -c do-nothing POSIX option -n do-nothing POSIX option -? -h, --help produce this help message -V, --version report flex version sbs5@lion:~/cs200/www/lectures$ -f, --full generate fast, large scanner. Same as -Cfr -f,: command not found sbs5@lion:~/cs200/www/lectures$ p Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> def d(): ... retututut 9 File "", line 2 retututut 9 ^ SyntaxError: invalid syntax >>> sbs5@lion:~/cs200/www/lectures$ which yacc /usr/bin/yacc sbs5@lion:~/cs200/www/lectures$ which bison /usr/bin/bison sbs5@lion:~/cs200/www/lectures$ ls byt* bytecode.py sbs5@lion:~/cs200/www/lectures$ p Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from bytecode import * >>> s() 3 >>> dir(s) ['__annotations__', '__builtins__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__getstate__', '__globals__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__kwdefaults__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__type_params__'] >>> s.__name)) File "", line 1 s.__name)) ^ SyntaxError: unmatched ')' >>> s.__name__ 's' >>> s.__code__ >>> dir(s.__code__) ['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_co_code_adaptive', '_varname_from_oparg', 'co_argcount', 'co_cellvars', 'co_code', 'co_consts', 'co_exceptiontable', 'co_filename', 'co_firstlineno', 'co_flags', 'co_freevars', 'co_kwonlyargcount', 'co_lines', 'co_linetable', 'co_lnotab', 'co_name', 'co_names', 'co_nlocals', 'co_positions', 'co_posonlyargcount', 'co_qualname', 'co_stacksize', 'co_varnames', 'replace'] >>> s.__code__.co_name 's' >>> s.__code__.co_lines >>> s.__code__.co_filename '/home/httpd/html/zoo/classes/cs200/lectures/bytecode.py' >>> s.__code__.co_consts (None, 1, 2) >>> s.__code__.co_varnames ('a', 'b') >>> s.__code__.co_code b'\x97\x00d\x01}\x00d\x02}\x01|\x00|\x01z\x00\x00\x00S\x00' >>> xf(s) co_argcount: 0 co_cellvars: () co_code: b'\x97\x00d\x01}\x00d\x02}\x01|\x00|\x01z\x00\x00\x00S\x00' co_consts: (None, 1, 2) co_exceptiontable: b'' co_filename: /home/httpd/html/zoo/classes/cs200/lectures/bytecode.py co_firstlineno: 9 co_flags: 3 co_freevars: () co_kwonlyargcount: 0 co_lines: co_linetable: b'\x80\x00\xd8\x08\t\x80A\xd8\x08\t\x80A\xd8\x0c\r\x90\x01\x89E\x80N' co_lnotab: b'\x02\x01\x04\x01\x04\x01' co_name: s co_names: () co_nlocals: 2 co_positions: co_posonlyargcount: 0 co_qualname: s co_stacksize: 2 co_varnames: ('a', 'b') >>> xf(s,True) __class__: __delattr__: __dir__: __doc__: Create a code object. Not for the faint of heart. __eq__: __format__: __ge__: __getattribute__: __getstate__: __gt__: __hash__: __init__: __init_subclass__: __le__: __lt__: __ne__: __new__: __reduce__: __reduce_ex__: __repr__: __setattr__: __sizeof__: __str__: __subclasshook__: _co_code_adaptive: b'\x97\x00d\x01}\x00d\x02\x9a\x01X\x00|\x01z\x00\x01\x00S\x00' _varname_from_oparg: co_argcount: 0 co_cellvars: () co_code: b'\x97\x00d\x01}\x00d\x02}\x01|\x00|\x01z\x00\x00\x00S\x00' co_consts: (None, 1, 2) co_exceptiontable: b'' co_filename: /home/httpd/html/zoo/classes/cs200/lectures/bytecode.py co_firstlineno: 9 co_flags: 3 co_freevars: () co_kwonlyargcount: 0 co_lines: co_linetable: b'\x80\x00\xd8\x08\t\x80A\xd8\x08\t\x80A\xd8\x0c\r\x90\x01\x89E\x80N' co_lnotab: b'\x02\x01\x04\x01\x04\x01' co_name: s co_names: () co_nlocals: 2 co_positions: co_posonlyargcount: 0 co_qualname: s co_stacksize: 2 co_varnames: ('a', 'b') replace: >>> getbytes(s) b'\x97\x00d\x01}\x00d\x02}\x01|\x00|\x01z\x00\x00\x00S\x00' >>> printbytes(s) 151 0 100 1 125 0 100 2 125 1 124 0 124 1 122 0 0 0 83 0 >>> \x97 File "", line 1 \x97 ^ SyntaxError: unexpected character after line continuation character >>> print (\x97) File "", line 1 print (\x97) ^ SyntaxError: unexpected character after line continuation character >>> print (b'\x97') b'\x97' >>> printbytes(s) 151 0 100 1 125 0 100 2 125 1 124 0 124 1 122 0 0 0 83 0 >>> dir(opcode) ['ENABLE_SPECIALIZATION', 'EXTENDED_ARG', 'HAVE_ARGUMENT', 'MAX_PSEUDO_OPCODE', 'MIN_INSTRUMENTED_OPCODE', 'MIN_PSEUDO_OPCODE', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_cache_format', '_inline_cache_entries', '_intrinsic_1_descs', '_intrinsic_2_descs', '_nb_ops', '_pseudo_ops', '_specializations', '_specialized_instructions', 'cmp_op', 'hasarg', 'hascompare', 'hasconst', 'hasexc', 'hasfree', 'hasjabs', 'hasjrel', 'haslocal', 'hasname', 'i', 'is_pseudo', 'op', 'oplists', 'opmap', 'opname', 'stack_effect'] >>> opcode.opname ['CACHE', 'POP_TOP', 'PUSH_NULL', 'INTERPRETER_EXIT', 'END_FOR', 'END_SEND', '<6>', '<7>', '<8>', 'NOP', '<10>', 'UNARY_NEGATIVE', 'UNARY_NOT', '<13>', '<14>', 'UNARY_INVERT', '<16>', 'RESERVED', '<18>', '<19>', '<20>', '<21>', '<22>', '<23>', '<24>', 'BINARY_SUBSCR', 'BINARY_SLICE', 'STORE_SLICE', '<28>', '<29>', 'GET_LEN', 'MATCH_MAPPING', 'MATCH_SEQUENCE', 'MATCH_KEYS', '<34>', 'PUSH_EXC_INFO', 'CHECK_EXC_MATCH', 'CHECK_EG_MATCH', '<38>', '<39>', '<40>', '<41>', '<42>', '<43>', '<44>', '<45>', '<46>', '<47>', '<48>', 'WITH_EXCEPT_START', 'GET_AITER', 'GET_ANEXT', 'BEFORE_ASYNC_WITH', 'BEFORE_WITH', 'END_ASYNC_FOR', 'CLEANUP_THROW', '<56>', '<57>', '<58>', '<59>', 'STORE_SUBSCR', 'DELETE_SUBSCR', '<62>', '<63>', '<64>', '<65>', '<66>', '<67>', 'GET_ITER', 'GET_YIELD_FROM_ITER', '<70>', 'LOAD_BUILD_CLASS', '<72>', '<73>', 'LOAD_ASSERTION_ERROR', 'RETURN_GENERATOR', '<76>', '<77>', '<78>', '<79>', '<80>', '<81>', '<82>', 'RETURN_VALUE', '<84>', 'SETUP_ANNOTATIONS', '<86>', 'LOAD_LOCALS', '<88>', 'POP_EXCEPT', 'STORE_NAME', 'DELETE_NAME', 'UNPACK_SEQUENCE', 'FOR_ITER', 'UNPACK_EX', 'STORE_ATTR', 'DELETE_ATTR', 'STORE_GLOBAL', 'DELETE_GLOBAL', 'SWAP', 'LOAD_CONST', 'LOAD_NAME', 'BUILD_TUPLE', 'BUILD_LIST', 'BUILD_SET', 'BUILD_MAP', 'LOAD_ATTR', 'COMPARE_OP', 'IMPORT_NAME', 'IMPORT_FROM', 'JUMP_FORWARD', '<111>', '<112>', '<113>', 'POP_JUMP_IF_FALSE', 'POP_JUMP_IF_TRUE', 'LOAD_GLOBAL', 'IS_OP', 'CONTAINS_OP', 'RERAISE', 'COPY', 'RETURN_CONST', 'BINARY_OP', 'SEND', 'LOAD_FAST', 'STORE_FAST', 'DELETE_FAST', 'LOAD_FAST_CHECK', 'POP_JUMP_IF_NOT_NONE', 'POP_JUMP_IF_NONE', 'RAISE_VARARGS', 'GET_AWAITABLE', 'MAKE_FUNCTION', 'BUILD_SLICE', 'JUMP_BACKWARD_NO_INTERRUPT', 'MAKE_CELL', 'LOAD_CLOSURE', 'LOAD_DEREF', 'STORE_DEREF', 'DELETE_DEREF', 'JUMP_BACKWARD', 'LOAD_SUPER_ATTR', 'CALL_FUNCTION_EX', 'LOAD_FAST_AND_CLEAR', 'EXTENDED_ARG', 'LIST_APPEND', 'SET_ADD', 'MAP_ADD', '<148>', 'COPY_FREE_VARS', 'YIELD_VALUE', 'RESUME', 'MATCH_CLASS', '<153>', '<154>', 'FORMAT_VALUE', 'BUILD_CONST_KEY_MAP', 'BUILD_STRING', '<158>', '<159>', '<160>', '<161>', 'LIST_EXTEND', 'SET_UPDATE', 'DICT_MERGE', 'DICT_UPDATE', '<166>', '<167>', '<168>', '<169>', '<170>', 'CALL', 'KW_NAMES', 'CALL_INTRINSIC_1', 'CALL_INTRINSIC_2', 'LOAD_FROM_DICT_OR_GLOBALS', 'LOAD_FROM_DICT_OR_DEREF', '<177>', '<178>', '<179>', '<180>', '<181>', '<182>', '<183>', '<184>', '<185>', '<186>', '<187>', '<188>', '<189>', '<190>', '<191>', '<192>', '<193>', '<194>', '<195>', '<196>', '<197>', '<198>', '<199>', '<200>', '<201>', '<202>', '<203>', '<204>', '<205>', '<206>', '<207>', '<208>', '<209>', '<210>', '<211>', '<212>', '<213>', '<214>', '<215>', '<216>', '<217>', '<218>', '<219>', '<220>', '<221>', '<222>', '<223>', '<224>', '<225>', '<226>', '<227>', '<228>', '<229>', '<230>', '<231>', '<232>', '<233>', '<234>', '<235>', '<236>', 'INSTRUMENTED_LOAD_SUPER_ATTR', 'INSTRUMENTED_POP_JUMP_IF_NONE', 'INSTRUMENTED_POP_JUMP_IF_NOT_NONE', 'INSTRUMENTED_RESUME', 'INSTRUMENTED_CALL', 'INSTRUMENTED_RETURN_VALUE', 'INSTRUMENTED_YIELD_VALUE', 'INSTRUMENTED_CALL_FUNCTION_EX', 'INSTRUMENTED_JUMP_FORWARD', 'INSTRUMENTED_JUMP_BACKWARD', 'INSTRUMENTED_RETURN_CONST', 'INSTRUMENTED_FOR_ITER', 'INSTRUMENTED_POP_JUMP_IF_FALSE', 'INSTRUMENTED_POP_JUMP_IF_TRUE', 'INSTRUMENTED_END_FOR', 'INSTRUMENTED_END_SEND', 'INSTRUMENTED_INSTRUCTION', 'INSTRUMENTED_LINE', '<255>', 'SETUP_FINALLY', 'SETUP_CLEANUP', 'SETUP_WITH', 'POP_BLOCK', 'JUMP', 'JUMP_NO_INTERRUPT', 'LOAD_METHOD', 'LOAD_SUPER_METHOD', 'LOAD_ZERO_SUPER_METHOD', 'LOAD_ZERO_SUPER_ATTR', 'STORE_FAST_MAYBE_NULL'] >>> opcode.opname[157] 'BUILD_STRING' >>> opcode.opname[100] 'LOAD_CONST' >>> opcode.opname[25] 'BINARY_SUBSCR' >>> printbytes(s) 151 0 100 1 125 0 100 2 125 1 124 0 124 1 122 0 0 0 83 0 >>> printopcodes(s) 151: RESUME 0: CACHE 100: LOAD_CONST 1: POP_TOP 125: STORE_FAST 0: CACHE 100: LOAD_CONST 2: PUSH_NULL 125: STORE_FAST 1: POP_TOP 124: LOAD_FAST 0: CACHE 124: LOAD_FAST 1: POP_TOP 122: BINARY_OP 0: CACHE 0: CACHE 0: CACHE 83: RETURN_VALUE 0: CACHE >>> dir(dis) ['BINARY_OP', 'Bytecode', 'CACHE', 'CALL_INTRINSIC_1', 'CALL_INTRINSIC_2', 'COMPILER_FLAG_NAMES', 'EXTENDED_ARG', 'FORMAT_VALUE', 'FORMAT_VALUE_CONVERTERS', 'FOR_ITER', 'HAVE_ARGUMENT', 'Instruction', 'JUMP_BACKWARD', 'LOAD_ATTR', 'LOAD_CONST', 'LOAD_GLOBAL', 'LOAD_SUPER_ATTR', 'MAKE_FUNCTION', 'MAKE_FUNCTION_FLAGS', 'Positions', 'RETURN_CONST', 'SEND', 'UNKNOWN', '_ExceptionTableEntry', '_INT_BITS', '_INT_OVERFLOW', '_Instruction', '_OPARG_WIDTH', '_OPNAME_WIDTH', '_Unknown', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_all_opmap', '_all_opname', '_cache_format', '_deoptop', '_disassemble_bytes', '_disassemble_recursive', '_disassemble_str', '_empty_slot', '_find_imports', '_find_store_names', '_format_code_info', '_get_code_array', '_get_code_object', '_get_const_info', '_get_const_value', '_get_instructions_bytes', '_get_name_info', '_have_code', '_inline_cache_entries', '_intrinsic_1_descs', '_intrinsic_2_descs', '_is_backward_jump', '_nb_ops', '_parse_exception_table', '_parse_varint', '_specializations', '_specialized_instructions', '_try_compile', '_unpack_opargs', 'cmp_op', 'code_info', 'collections', 'deoptmap', 'dis', 'disassemble', 'disco', 'distb', 'findlabels', 'findlinestarts', 'get_instructions', 'hasarg', 'hascompare', 'hasconst', 'hasexc', 'hasfree', 'hasjabs', 'hasjrel', 'haslocal', 'hasname', 'io', 'main', 'opmap', 'opname', 'pretty_flags', 'show_code', 'spec_op', 'specialized', 'stack_effect', 'sys', 'types'] >>> dis.dis(s) 9 0 RESUME 0 10 2 LOAD_CONST 1 (1) 4 STORE_FAST 0 (a) 11 6 LOAD_CONST 2 (2) 8 STORE_FAST 1 (b) 12 10 LOAD_FAST 0 (a) 12 LOAD_FAST 1 (b) 14 BINARY_OP 0 (+) 18 RETURN_VALUE >>> s.__code__.co_varnames ('a', 'b') >>> s.__code__.co_varnames[0] 'a' >>> showme(s)\ ... 9 0 RESUME 0 10 2 LOAD_CONST 1 (1) 4 STORE_FAST 0 (a) 11 6 LOAD_CONST 2 (2) 8 STORE_FAST 1 (b) 12 10 LOAD_FAST 0 (a) 12 LOAD_FAST 1 (b) 14 BINARY_OP 0 (+) 18 RETURN_VALUE Name: s Filename: /home/httpd/html/zoo/classes/cs200/lectures/bytecode.py Argument count: 0 Positional-only arguments: 0 Kw-only arguments: 0 Number of locals: 2 Stack size: 2 Flags: OPTIMIZED, NEWLOCALS Constants: 0: None 1: 1 2: 2 Variable names: 0: a 1: b >>> sbs5@lion:~/cs200/www/lectures$ cd /c/cs2000/hws sbs5@lion:/c/cs2000/hws$ ls hw0a.pyc hw1.py hw3a.pyc hw4a.pyc hw5.py hw0.py hw2a.pyc hw3match.py hw4.py __pycache__ hw1a.pyc hw2.py hw3.py hw4.py~ sbs5@lion:/c/cs2000/hws$ p Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from hw5 import * >>> s3() 2 >>> dis.dis(s3) 171 0 RESUME 0 172 2 LOAD_CONST 1 (1) 4 STORE_FAST 0 (a) 173 6 LOAD_FAST 0 (a) 8 LOAD_CONST 1 (1) 10 BINARY_OP 0 (+) 14 RETURN_VALUE >>> dis.dis(s3b) 180 0 RESUME 0 181 2 LOAD_CONST 1 (1) 4 STORE_FAST 0 (a) 182 6 LOAD_CONST 2 (2) 8 STORE_FAST 1 (b) 183 10 LOAD_FAST 0 (a) 12 LOAD_FAST 1 (b) 14 BINARY_OP 10 (-) 18 RETURN_VALUE >>> dis.dis(s3c) 185 0 RESUME 0 186 2 LOAD_CONST 1 (2) 4 STORE_FAST 0 (a) 187 6 LOAD_CONST 2 (3) 8 STORE_FAST 1 (b) 188 10 LOAD_FAST 0 (a) 12 LOAD_FAST 1 (b) 14 BINARY_OP 8 (**) 18 RETURN_VALUE >>> from PVM import * Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'PVM' >>> sbs5@lion:/c/cs2000/hws$ cd - /home/accts/sbs5/cs200/www/lectures sbs5@lion:~/cs200/www/lectures$ p Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from PVM import * Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'PVM' >>> from pvm import * >>> what_to_execute {'instructions': [('LOAD_VALUE', 0), ('LOAD_VALUE', 1), ('ADD_TWO_VALUES', None), ('PRINT_ANSWER', None)], 'numbers': [7, 5]} >>> test() 12 >>> test2() 3 >>> test3() ('LOAD_VALUE', 0) ('STORE_NAME', 0) ('LOAD_VALUE', 1) ('STORE_NAME', 1) ('LOAD_NAME', 0) ('LOAD_NAME', 1) ('ADD_TWO_VALUES', None) ('PRINT_ANSWER', None) 3 >>> sbs5@lion:~/cs200/www/lectures$ cd - /c/cs2000/hws sbs5@lion:/c/cs2000/hws$ ls hw0a.pyc hw1.py hw3a.pyc hw4a.pyc hw5.py hw0.py hw2a.pyc hw3match.py hw4.py __pycache__ hw1a.pyc hw2.py hw3.py hw4.py~ sbs5@lion:/c/cs2000/hws$ exit Process shell finished