pythontutor้กน็›ฎ่งฃๅ‰–

่ฏดๆ˜Ž

ๆœฌๆ–‡ไธป่ฆๅ‰–ๆžไธ€ไธ‹pythontutor็š„้กน็›ฎ็ป“ๆž„ไธŽไธšๅŠกๆต็จ‹๏ผŒๅนถ็กฎๅฎšๅŽ้ข็š„็›ธๅ…ณไปฃ็ ๅฏ่ง†ๅŒ–็š„ไฝฟ็”จๆ–นๆณ•

ๆ€ปไฝ“็ป“ๆž„ๅ›พ

pythontutor็ป“ๆž„ๅ›พ

                                                                                                                                                  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ 
                                                                                                                                                  โ”ƒ                              _                    _                            โ”ƒ 
                                                                                                                                                  โ”ƒ                _ __  __ _ __| |____ _ __ _ ___   (_)___ ___ _ _                โ”ƒ 
                                                                                                                                                  โ”ƒ               | '_ \/ _` / _| / / _` / _` / -_)_ | (_-</ _ \ ' \               โ”ƒ 
                                                                                                                                                  โ”ƒ               | .__/\__,_\__|_\_\__,_\__, \___(_)/ /__/\___/_||_|              โ”ƒ 
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“                                                               โ”ƒ               |_|                    |___/     |__/                            โ”ƒ 
โ”ƒ       ___      _   _               _____     _             ___                  โ”ƒ                                                               โ”ƒ                                                                                โ”ƒ 
โ”ƒ      | _ \_  _| |_| |_  ___ _ _   |_   _|  _| |_ ___ _ _  | __|_ _____ __       โ”ƒ                                                               โ”ƒ   {                                                                            โ”ƒ 
โ”ƒ      |  _/ || |  _| ' \/ _ \ ' \    | || || |  _/ _ \ '_| | _|\ \ / -_) _|      โ”ƒ                                                               โ”ƒ     "name": "v5-unity",                                                        โ”ƒ 
โ”ƒ      |_|  \_, |\__|_||_\___/_||_|   |_| \_,_|\__\___/_|   |___/_\_\___\__|      โ”ƒ                                                               โ”ƒ     "version": "1.0.0",                                                        โ”ƒ 
โ”ƒ           |__/                                                                  โ”ƒ                                                               โ”ƒ     "description": "OPT v5",                                                   โ”ƒ 
โ”ƒ                                                                                 โ”ƒ                                                               โ”ƒ     "main": "bundle.js",                                                       โ”ƒ 
โ”ƒ                                                                                 โ”ƒ                                                               โ”ƒ     "repository": "https://github.com/pgbovine/OnlinePythonTutor",             โ”ƒ 
โ”ƒ                                                                                 โ”ƒ                                                               โ”ƒ     "license": "BSD-3-Clause",                                                 โ”ƒ 
โ”ƒ                                                                                 โ”ƒ                                                               โ”ƒ     "scripts": {                                                               โ”ƒ 
โ”ƒ  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                     โ”ƒ                                                               โ”ƒ       "start": "python bottle_server.py",                                      โ”ƒ 
โ”ƒ  โ”‚                        โ”‚                                                     โ”ƒ                                                               โ”ƒ       "py3start": "python3 bottle_server.py",                                  โ”ƒ 
โ”ƒ  โ”‚    botter_server.py    โ”‚                                                     โ”ƒ                                                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ       "webpack": "webpack --devtool sourcemap --progress --colors --watch",    โ”ƒ 
โ”ƒ  โ”‚      get_py_exec       โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                        โ”ƒ                                                     โ”‚         โ”ƒ       "production-build": "rm -f build/* && webpack && python                  โ”ƒ 
โ”ƒ  โ”‚                        โ”‚            โ”‚                                        โ”ƒ                                                     โ”‚         โ”ƒ   add_cache_busting_query_strings.py"                                          โ”ƒ 
โ”ƒ  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚                                        โ”ƒ                                                     โ”‚         โ”ƒ     },                                                                         โ”ƒ 
โ”ƒ                                        โ”‚                                        โ”ƒ                                                     โ”‚         โ”ƒ     "dependencies": {                                                          โ”ƒ 
โ”ƒ                                        โ”‚           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”ƒ                                                     โ”‚         โ”ƒ       "css-loader": "",                                                        โ”ƒ 
โ”ƒ                                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ                         โ”‚  โ”ƒ                                   npm run production-build    โ”ƒ       "fs-extra": "^6.0.1",                                                    โ”ƒ 
โ”ƒ                                                    โ”‚      pg_logger.py       โ”‚  โ”ƒ                                                     โ”‚         โ”ƒ       "json-stable-stringify": "^1.0.1",                                       โ”ƒ 
โ”ƒ                                                    โ”‚  exec_script_str_local  โ”‚  โ”ƒ                                                     โ”‚         โ”ƒ       "on-build-webpack": "^0.1.0",                                            โ”ƒ 
โ”ƒ                                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค                         โ”‚  โ”ƒ                                                     โ”‚         โ”ƒ       "pixelmatch": "^4.0.2",                                                  โ”ƒ 
โ”ƒ                                        โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”ƒ                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚         โ”ƒ       "puppeteer": "^1.5.0",                                                   โ”ƒ 
โ”ƒ                                        โ”‚                                        โ”ƒ                  โ”‚                         โ”‚        โ”‚         โ”ƒ       "script-loader": "",                                                     โ”ƒ 
โ”ƒ                                        โ”‚                                        โ”ƒ                  โ”‚     /visualize.html     โ”‚        โ”‚         โ”ƒ       "style-loader": "",                                                      โ”ƒ 
โ”ƒ                                        โ”‚                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•‹โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ   visualize.bundle.js   โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”ƒ       "ts-loader": "^3.5.0",                                                   โ”ƒ 
โ”ƒ  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚                       โ”‚                โ”ƒ                  โ”‚                         โ”‚                  โ”ƒ       "url-loader": ""                                                         โ”ƒ 
โ”ƒ  โ”‚                         โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               return trace info        โ”ƒ                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ”ƒ     }                                                                          โ”ƒ 
โ”ƒ  โ”‚      pg_logger.py       โ”‚                         {code: '', trace: []}      โ”ƒ                                                               โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ–ฒโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”› 
โ”ƒ  โ”‚   PGLogger._runscript   โ”‚                                   โ”‚                โ”ƒ                                                                                                       โ”‚                                          
โ”ƒ  โ”‚                         โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ”ƒ                                                                                                       โ”‚                                          
โ”ƒ  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”ƒ                                                                                                   webpack                                        
โ”ƒ                                                                                 โ”ƒ                                                                                                       โ”‚                                          
โ”ƒ                                                                                 โ”ƒ                                                                                                       โ”‚                                          
โ”ƒ                                                                                 โ”ƒ                                                                โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ                                                                                 โ”ƒ                                                                โ”ƒ                  _                  _                  __ _         _          โ”ƒ
โ”ƒ                                                                                 โ”ƒ                                                                โ”ƒ      __ __ _____| |__ _ __  __ _ __| |__  __ ___ _ _  / _(_)__ _   (_)___      โ”ƒ
โ”ƒ                                                                                 โ”ƒ                                                                โ”ƒ      \ V  V / -_) '_ \ '_ \/ _` / _| / /_/ _/ _ \ ' \|  _| / _` |_ | (_-<      โ”ƒ
โ”ƒ                                                                                 โ”ƒ                                                                โ”ƒ       \_/\_/\___|_.__/ .__/\__,_\__|_\_(_)__\___/_||_|_| |_\__, (_)/ /__/      โ”ƒ
โ”ƒ                                                                                 โ”ƒ                                                                โ”ƒ                      |_|                                   |___/ |__/          โ”ƒ
โ”ƒ                                                                                 โ”ƒ                                                                โ”ƒ   entry: {                                                                     โ”ƒ
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›                                                                โ”ƒ       'visualize': "./js/visualize.ts",                                        โ”ƒ
                                                                                                                                                   โ”ƒ       'recorder': "./js/recorder.ts",                                          โ”ƒ
                                                                                                                                                   โ”ƒ       'render-trace': "./js/render-trace.ts",                                  โ”ƒ
                                                                                                                                                   โ”ƒ       'opt-live': "./js/opt-live.ts",                                          โ”ƒ
                                                                                                                                                   โ”ƒ       'iframe-embed': "./js/iframe-embed.ts",                                  โ”ƒ
                                                                                                                                                   โ”ƒ       'index': "./js/index.ts",                                                โ”ƒ
                                                                                                                                                   โ”ƒ       'composingprograms': "./js/composingprograms.ts",                        โ”ƒ
                                                                                                                                                   โ”ƒ       'csc108h': "./js/csc108h.ts",                                            โ”ƒ
                                                                                                                                                   โ”ƒ       'pytutor-embed': "./js/pytutor-embed.ts",                                โ”ƒ
                                                                                                                                                   โ”ƒ   },                                                                           โ”ƒ
                                                                                                                                                   โ”ƒ                                                                                โ”ƒ
                                                                                                                                                   โ”ƒ   output: {                                                                    โ”ƒ
                                                                                                                                                   โ”ƒ       path: __dirname + "/build/",                                             โ”ƒ
                                                                                                                                                   โ”ƒ       // TODO: use 'bundle.[hash].js' for fingerprint hashing                  โ”ƒ
                                                                                                                                                   โ”ƒ       // to create unique filenames for releases:                              โ”ƒ
                                                                                                                                                   โ”ƒ       // https://webpack.github.io/docs/long-term-caching.html                 โ”ƒ
                                                                                                                                                   โ”ƒ       filename: "[name].bundle.js",                                            โ”ƒ
                                                                                                                                                   โ”ƒ       sourceMapFilename: "[file].map",                                         โ”ƒ
                                                                                                                                                   โ”ƒ   },                                                                           โ”ƒ
                                                                                                                                                   โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›

iframeไฝฟ็”จ็คบไพ‹

ไฝฟ็”จbottleๅ†™webๆœๅŠก

from bottle import route, get, request, run, template, static_file

try:
    import StringIO  # NB: don't use cStringIO since it doesn't support unicode!!!
except:
    import io as StringIO  # py3
import json
import pg_logger


@route('/web_exec_<name:re:.+>.py')
@route('/LIVE_exec_<name:re:.+>.py')
@route('/viz_interaction.py')
@route('/syntax_err_survey.py')
@route('/runtime_err_survey.py')
@route('/eureka_survey.py')
@route('/error_log.py')
def dummy_ok(name=None):
    return 'OK'


@route('/<filepath:path>')
def index(filepath):
    return static_file(filepath, root='.')


# Note that this will run either Python 2 or 3, depending on which
# version of Python you used to start the server, REGARDLESS of which
# route was taken:
@route('/web_exec_py2.py')
@route('/web_exec_py3.py')
@route('/LIVE_exec_py2.py')
@route('/LIVE_exec_py3.py')
def get_py_exec():
    out_s = StringIO.StringIO()

    def json_finalizer(input_code, output_trace):
        ret = dict(code=input_code, trace=output_trace)
        json_output = json.dumps(ret, indent=None)
        out_s.write(json_output)

    options = json.loads(request.query.options_json)

    pg_logger.exec_script_str_local(request.query.user_script,
                                    request.query.raw_input_json,
                                    options['cumulative_mode'],
                                    options['heap_primitives'],
                                    json_finalizer)

    return out_s.getvalue()


if __name__ == "__main__":
    run(host='localhost', port=8003, reloader=True)

่ฟ™้‡Œๅฏไปฅๅ‘็Žฐ๏ผŒไฝœ่€…็š„่ทฏ็”ฑๅŸบๆœฌๆฑ‡่šๅœจget_py_exec, ่ฟ›ๅ…ฅๅŽๆ‰ง่กŒexec_script_str_local

pg_logger.pyไป‹็ป

python tutorๆ ธๅฟƒ็ฑป

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                        
โ”‚                   โ”‚                                                        
โ”‚ botter_server.py  โ”‚                                                        
โ”‚    get_py_exec    โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                         
โ”‚                   โ”‚              โ”‚                                         
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ”‚                                         
                                   โ”‚                                         
                                   โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ                         โ”‚
                                                  โ”‚      pg_logger.py       โ”‚
                                                  โ”‚  exec_script_str_local  โ”‚
                                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค                         โ”‚
                                      โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                      โ”‚                                      
                                      โ”‚                                      
                                      โ”‚                                      
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚                                      
โ”‚                         โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                      
โ”‚      pg_logger.py       โ”‚                                                  
โ”‚   PGLogger._runscript   โ”‚                                                  
โ”‚                         โ”‚                                                  
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                  

็ปงๆ‰ฟ่‡ชBdb

class PGLogger(bdb.Bdb):

ๅˆๅง‹ๅŒ–็›ธๅ…ณ

    def __init__(
            self,
            cumulative_mode,
            heap_primitives,
            show_only_outputs,
            finalizer_func,
            disable_security_checks=False,
            allow_all_modules=False,
            crazy_mode=False,
            custom_modules=None,
            separate_stdout_by_module=False,
            probe_exprs=None):

่ฐƒ็”จๅ‡ฝๆ•ฐ

def exec_script_str_local(
        script_str,
        raw_input_lst_json,
        cumulative_mode,
        heap_primitives,
        finalizer_func,
        probe_exprs=None,
        allow_all_modules=False):
    # ๆ ธๅฟƒ่ฟ่กŒ่ฟ‡็จ‹่ฎฐๅฝ•็ฑป
    logger = PGLogger(
        cumulative_mode,
        heap_primitives,
        False,
        finalizer_func,
        disable_security_checks=True,
        allow_all_modules=allow_all_modules,
        probe_exprs=probe_exprs
    )

    # TODO: refactor these NOT to be globals
    global input_string_queue
    input_string_queue = []
    if raw_input_lst_json:
        # TODO: if we want to support unicode, remove str() cast
        input_string_queue = [str(e) for e in json.loads(raw_input_lst_json)]

    try:
        logger._runscript(script_str)
    except bdb.BdbQuit:
        pass
    finally:
        return logger.finalize()

่ฟ”ๅ›žๆ•ฐๆฎ็คบไพ‹

{
  "code": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())",
  "trace": [
    {
      "line": 5,
      "event": "step_line",
      "func_name": "<module>",
      "globals": {},
      "ordered_globals": [],
      "stack_to_render": [],
      "heap": {},
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 19,
      "event": "step_line",
      "func_name": "<module>",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ]
      },
      "ordered_globals": [
        "Staff601"
      ],
      "stack_to_render": [],
      "heap": {},
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 10,
      "event": "call",
      "func_name": "__init__",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ]
      },
      "ordered_globals": [
        "Staff601"
      ],
      "stack_to_render": [
        {
          "func_name": "__init__",
          "is_parent": false,
          "frame_id": 1,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ],
            "name": "Pat",
            "role": "Professor",
            "years": 60,
            "salary": 100000
          },
          "ordered_varnames": [
            "self",
            "name",
            "role",
            "years",
            "salary"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "__init___f1"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601"
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 11,
      "event": "step_line",
      "func_name": "__init__",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ]
      },
      "ordered_globals": [
        "Staff601"
      ],
      "stack_to_render": [
        {
          "func_name": "__init__",
          "is_parent": false,
          "frame_id": 1,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ],
            "name": "Pat",
            "role": "Professor",
            "years": 60,
            "salary": 100000
          },
          "ordered_varnames": [
            "self",
            "name",
            "role",
            "years",
            "salary"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "__init___f1"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601"
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 12,
      "event": "step_line",
      "func_name": "__init__",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ]
      },
      "ordered_globals": [
        "Staff601"
      ],
      "stack_to_render": [
        {
          "func_name": "__init__",
          "is_parent": false,
          "frame_id": 1,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ],
            "name": "Pat",
            "role": "Professor",
            "years": 60,
            "salary": 100000
          },
          "ordered_varnames": [
            "self",
            "name",
            "role",
            "years",
            "salary"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "__init___f1"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "name",
            "Pat"
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 13,
      "event": "step_line",
      "func_name": "__init__",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ]
      },
      "ordered_globals": [
        "Staff601"
      ],
      "stack_to_render": [
        {
          "func_name": "__init__",
          "is_parent": false,
          "frame_id": 1,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ],
            "name": "Pat",
            "role": "Professor",
            "years": 60,
            "salary": 100000
          },
          "ordered_varnames": [
            "self",
            "name",
            "role",
            "years",
            "salary"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "__init___f1"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "name",
            "Pat"
          ],
          [
            "role",
            "Professor"
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 14,
      "event": "step_line",
      "func_name": "__init__",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ]
      },
      "ordered_globals": [
        "Staff601"
      ],
      "stack_to_render": [
        {
          "func_name": "__init__",
          "is_parent": false,
          "frame_id": 1,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ],
            "name": "Pat",
            "role": "Professor",
            "years": 60,
            "salary": 100000
          },
          "ordered_varnames": [
            "self",
            "name",
            "role",
            "years",
            "salary"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "__init___f1"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "age",
            60
          ],
          [
            "name",
            "Pat"
          ],
          [
            "role",
            "Professor"
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 14,
      "event": "return",
      "func_name": "__init__",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ]
      },
      "ordered_globals": [
        "Staff601"
      ],
      "stack_to_render": [
        {
          "func_name": "__init__",
          "is_parent": false,
          "frame_id": 1,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ],
            "name": "Pat",
            "role": "Professor",
            "years": 60,
            "salary": 100000,
            "__return__": null
          },
          "ordered_varnames": [
            "self",
            "name",
            "role",
            "years",
            "salary",
            "__return__"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "__init___f1"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "age",
            60
          ],
          [
            "name",
            "Pat"
          ],
          [
            "role",
            "Professor"
          ],
          [
            "salary",
            100000
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 20,
      "event": "step_line",
      "func_name": "<module>",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ],
        "pat": [
          "REF",
          1
        ]
      },
      "ordered_globals": [
        "Staff601",
        "pat"
      ],
      "stack_to_render": [],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "age",
            60
          ],
          [
            "name",
            "Pat"
          ],
          [
            "role",
            "Professor"
          ],
          [
            "salary",
            100000
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 16,
      "event": "call",
      "func_name": "salutation",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ],
        "pat": [
          "REF",
          1
        ]
      },
      "ordered_globals": [
        "Staff601",
        "pat"
      ],
      "stack_to_render": [
        {
          "func_name": "salutation",
          "is_parent": false,
          "frame_id": 2,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ]
          },
          "ordered_varnames": [
            "self"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "salutation_f2"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "age",
            60
          ],
          [
            "name",
            "Pat"
          ],
          [
            "role",
            "Professor"
          ],
          [
            "salary",
            100000
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 17,
      "event": "step_line",
      "func_name": "salutation",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ],
        "pat": [
          "REF",
          1
        ]
      },
      "ordered_globals": [
        "Staff601",
        "pat"
      ],
      "stack_to_render": [
        {
          "func_name": "salutation",
          "is_parent": false,
          "frame_id": 2,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ]
          },
          "ordered_varnames": [
            "self"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "salutation_f2"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "age",
            60
          ],
          [
            "name",
            "Pat"
          ],
          [
            "role",
            "Professor"
          ],
          [
            "salary",
            100000
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 17,
      "event": "return",
      "func_name": "salutation",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ],
        "pat": [
          "REF",
          1
        ]
      },
      "ordered_globals": [
        "Staff601",
        "pat"
      ],
      "stack_to_render": [
        {
          "func_name": "salutation",
          "is_parent": false,
          "frame_id": 2,
          "parent_frame_id_list": [],
          "encoded_locals": {
            "self": [
              "REF",
              1
            ],
            "__return__": "Professor Pat"
          },
          "ordered_varnames": [
            "self",
            "__return__"
          ],
          "is_zombie": false,
          "is_highlighted": true,
          "unique_hash": "salutation_f2"
        }
      ],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "age",
            60
          ],
          [
            "name",
            "Pat"
          ],
          [
            "role",
            "Professor"
          ],
          [
            "salary",
            100000
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\n"
    },
    {
      "line": 20,
      "event": "return",
      "func_name": "<module>",
      "globals": {
        "Staff601": [
          "IMPORTED_FAUX_PRIMITIVE",
          "imported class"
        ],
        "pat": [
          "REF",
          1
        ]
      },
      "ordered_globals": [
        "Staff601",
        "pat"
      ],
      "stack_to_render": [],
      "heap": {
        "1": [
          "INSTANCE",
          "Staff601",
          [
            "age",
            60
          ],
          [
            "name",
            "Pat"
          ],
          [
            "role",
            "Professor"
          ],
          [
            "salary",
            100000
          ]
        ]
      },
      "stdout": "# The __init__ 'constructor' - object-oriented programming intro\n# Adapted from MIT 6.01 course notes (Section 3.5)\n# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf\n\nclass Staff601:\n    course = '6.01'\n    building = 34\n    room = 501\n\n    def __init__(self, name, role, years, salary):\n      self.name = name\n      self.role = role\n      self.age = years\n      self.salary = salary\n\n    def salutation(self):\n        return self.role + ' ' + self.name\n\npat = Staff601('Pat', 'Professor', 60, 100000)\nprint(pat.salutation())\nProfessor Pat\n"
    }
  ]
}

ๅ‚่€ƒ่ต„ๆ–™