Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7593843

Browse filesBrowse files
author
Philip Guo
committed
added
1 parent 98e4671 commit 7593843
Copy full SHA for 7593843

File tree

Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Collapse file

‎PyTutorGAE/generate_json_trace.py‎

Copy file name to clipboard
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Generates a JSON trace that is compatible with the js/pytutor.js frontend
2+
3+
import sys, pg_logger, json
4+
5+
6+
def json_finalizer(input_code, output_trace):
7+
ret = dict(code=input_code, trace=output_trace)
8+
json_output = json.dumps(ret, indent=None) # use indent=None for most compact repr
9+
print json_output
10+
11+
12+
pg_logger.exec_script_str(open(sys.argv[1]).read(), json_finalizer)
13+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.