-
Notifications
You must be signed in to change notification settings - Fork 4
/
EmbeddedPythonConsoles.html
58 lines (55 loc) · 1.62 KB
/
EmbeddedPythonConsoles.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css"/>
<title>
Creating Embedded Python Consoles
</title>
</head>
<body>
<h1>
Creating Embedded Python Consoles
</h1>
<p>
Here are the steps for embedding a Python console
(from PythonAnywhere, at present) inside a web
page for one of our courses, or otherwise.
</p>
<ol>
<li>
Create a gist on GitHub by copying in the module
you want the students to run from the main repo
(or elsewhere).
</li>
<li>
From the gist repo copy the URL of the gist.
</li>
<li>
Modify ptml file to include <i>python_anywhere.txt</i>
at the place you want the console to appear.
This file exists in the algorithms/templates directory.
</li>
<li>
Include instruction for how to load and run
the code in python console.
<br />
Here is a sample of what sort of instructions you need:
<br />
<pre>
<code>
!git clone https://gist.github.com/25ffc0600a866535adef05c5d8eca34a.git
cd 25ffc0600a866535adef05c5d8eca34a
from find_max_subarray import *
A = [13, -3, -25, 20, -3, -16, -23, 18, 20, -7, 12, -5, -22, 15, -4, 7]
</code>
</pre>
</li>
<li>
Use sample data from the textbook on the web page.
</li>
<li>
Test, test, test
</li>
</ol>
</body>
</html>