File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ System architecture overview:
4343The Online Python Tutor is implemented as a web application, with a
4444JavaScript front-end making AJAX calls to a pure-Python back-end.
4545
46- The back-end has been tested on an Apache server running Python 2.5
46+ The back-end has been tested on an Apache server running Python 2.6
4747through CGI. Note that it will probably fail in subtle ways on other
4848Python 2.X (and will DEFINITELY fail on Python 3.X). Peter Wentworth
4949has create a port to Python 3.X, and hopefully we can eventually
@@ -97,8 +97,6 @@ The back-end resides in the cgi-bin/ sub-directory in this repository:
9797 grading back-end
9898 cgi-bin/pg_logger.py - the 'meat' of the back-end
9999 cgi-bin/pg_encoder.py - encodes Python data into JSON
100- cgi-bin/demjson.py - 3rd-party JSON module, since Python 2.5
101- doesn't have the built-in 'import json'
102100 cgi-bin/create_db.py - for optional sqlite query logging
103101 cgi-bin/db_common.py - for optional sqlite query logging
104102 cgi-bin/.htaccess - for Apache CGI execute permissions
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- #!/usr/bin/python2.5
1+ #!/usr/bin/python2.6
22
33# Online Python Tutor
44# https://github.com/pgbovine/OnlinePythonTutor/
Original file line number Diff line number Diff line change 2828# Python debugger imported via the bdb module), printing out the values
2929# of all in-scope data structures after each executed instruction.
3030
31- # Note that I've only tested this logger on Python 2.5 , so it will
31+ # Note that I've only tested this logger on Python 2.6 , so it will
3232# probably fail in subtle ways on other Python 2.X (and will DEFINITELY
3333# fail on Python 3.X).
3434
Original file line number Diff line number Diff line change 1- #!/usr/bin/python2.5
1+ #!/usr/bin/python2.6
22
33# Online Python Tutor
44# https://github.com/pgbovine/OnlinePythonTutor/
3131#
3232# Returns a complete JSON execution trace to the front-end.
3333#
34- # This version uses Python 2.5 on the MIT CSAIL servers.
35- # (note that Python 2.4 doesn't work on CSAIL, but Python 2.5 does)
34+ # This version uses Python 2.6 on the MIT CSAIL servers.
35+ # (note that Python 2.4 doesn't work on CSAIL, but Python 2.6 does)
3636#
3737# If you want to run this script, then you'll need to change the
3838# shebang line at the top of this file to point to your system's Python.
5050import cgi
5151import pg_logger
5252
53- # Python 2.5 doesn't have a built-in json module, so I'm using a
54- # 3rd-party module. I think you can do 'import json' in Python >= 2.6
55- import demjson
53+ import json
5654
5755if LOG_QUERIES :
5856 import os , time , db_common
5957
6058def web_finalizer (output_lst ):
6159 # use compactly=False to produce human-readable JSON,
6260 # except at the expense of being a LARGER download
63- output_json = demjson . encode (output_lst , compactly = True )
61+ output_json = json . dumps (output_lst )
6462
6563 # query logging is optional
6664 if LOG_QUERIES :
Original file line number Diff line number Diff line change 1- #!/usr/bin/python2.5
1+ #!/usr/bin/python2.6
22
33# Online Python Tutor
44# https://github.com/pgbovine/OnlinePythonTutor/
3333import cgi
3434import pg_logger
3535
36- # Python 2.5 doesn't have a built-in json module, so I'm using a
37- # 3rd-party module. I think you can do 'import json' in Python >= 2.6
38- import demjson
36+ import json
3937
4038user_trace = None # the FULL user trace (without any IDs, though)
4139expect_trace_final_entry = None
@@ -67,7 +65,7 @@ def expect_script_finalizer(output_lst):
6765 # Crucial first line to make sure that Apache serves this data
6866 # correctly - DON'T FORGET THE EXTRA NEWLINES!!!:
6967 print "Content-type: text/plain; charset=iso-8859-1\n \n "
70- output_json = demjson . encode (ret , compactly = True )
68+ output_json = json . dumps (ret )
7169 print output_json
7270
7371 else :
Original file line number Diff line number Diff line change 202202
203203< p />
204204This application supports the core < a
205- href ="http://www .python.org/doc /2.5 / "> Python 2.5 </ a > language, with no
205+ href ="http://docs .python.org/release /2.6 / "> Python 2.6 </ a > language, with no
206206module imports or file I/O. It's meant to be used as a platform for
207207creating programming tutorials, not for running or debugging
208208production code.
Original file line number Diff line number Diff line change 197197
198198< p />
199199This application supports the core < a
200- href ="http://www .python.org/doc /2.5 / "> Python 2.5 </ a > language, with no
200+ href ="http://docs .python.org/release /2.6 / "> Python 2.6 </ a > language, with no
201201module imports or file I/O. It's meant to be used as a platform for
202202creating programming tutorials, not for running or debugging
203203production code.
You can’t perform that action at this time.
0 commit comments