You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,11 +32,18 @@ Building with PreTeXt
32
32
33
33
1. Create a virtual environment
34
34
2. pip install pretextbook
35
-
3. To build run: pretext build --input pretext/thinkcspy.ptx --output output --format html --publication pretext/publication-rs-for-all.xml
35
+
3. To build run: pretext build web
36
36
4. pretext view html
37
37
38
38
Note: The pretext sources are in the pretext folder, we will keep the _sources folder until we are 100% sure that the book has been converted correctly and as thoroughly as possible.
39
39
40
+
Building for Production on a Runestone Server
41
+
---------------------------------------------
42
+
43
+
1. clone this repo to `httlacs` instead of `thinkcspy`
44
+
2. Run `rsmanage addcourse` and add `httlacs` as course name and base course name
<p>Starting in the Functions chapter, we have written unit tests using the <c>testEqual</c> function from
4
+
the <c>test</c> module. This test module is not included in the standard Python distribution. (There is
5
+
a standard test module but it is different from this.) What follows is the source code for this <c>test</c> module.</p>
6
+
<program language="python"><input>
7
+
def testEqual(actual,expected,places=5):
8
+
'''
9
+
Does the actual value equal the expected value?
10
+
For floats, places indicates how many places, right of the decimal, must be correct
11
+
'''
12
+
if isinstance(expected,float):
13
+
if abs(actual-expected) < 10**(-places):
14
+
print('\tPass')
15
+
return True
16
+
else:
17
+
if actual == expected:
18
+
print('\tPass')
19
+
return True
20
+
print('\tTest Failed: expected {} but got {}'.format(expected,actual))
21
+
return False
22
+
</input></program>
23
+
<p>To use this module when programming on your own computer, save the above code with the name <term>test.py</term> in the same folder as the python program you want to test.</p>
Copy file name to clipboardExpand all lines: pretext/Debugging/HowtoAvoidDebugging.ptx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ print(final_time)
66
66
</input>
67
67
</program>
68
68
<p>Hmm, when you run this example you see that something unexpected has happened. You would not realize this was an error unless you first knew what the program was supposed to do.</p>
69
-
<exercisexml:id="db_q_ex3_1">
69
+
<exerciselabel="db_q_ex3_1">
70
70
<statement>
71
71
<p>Which of the following best describes what is wrong with the previous example?</p>
0 commit comments