Show More
@@ -136,7 +136,7 b' The following is a very simple example of a valid demo file.' | |||
|
136 | 136 | #################### EXAMPLE DEMO <ex_demo.py> ############################### |
|
137 | 137 | '''A simple interactive demo to illustrate the use of IPython's Demo class.''' |
|
138 | 138 | |
|
139 |
print |
|
|
139 | print('Hello, welcome to an interactive IPython demo.') | |
|
140 | 140 | |
|
141 | 141 | # The mark below defines a block boundary, which is a point where IPython will |
|
142 | 142 | # stop execution and return to the interactive prompt. The dashes are actually |
@@ -152,21 +152,21 b' The following is a very simple example of a valid demo file.' | |||
|
152 | 152 | # the mark below makes this block as silent |
|
153 | 153 | # <demo> silent |
|
154 | 154 | |
|
155 |
print |
|
|
155 | print('This is a silent block, which gets executed but not printed.') | |
|
156 | 156 | |
|
157 | 157 | # <demo> stop |
|
158 | 158 | # <demo> auto |
|
159 |
print |
|
|
160 |
print |
|
|
161 | z = x+y | |
|
159 | print('This is an automatic block.') | |
|
160 | print('It is executed without asking for confirmation, but printed.') | |
|
161 | z = x + y | |
|
162 | 162 | |
|
163 |
print |
|
|
163 | print('z =', x) | |
|
164 | 164 | |
|
165 | 165 | # <demo> stop |
|
166 | 166 | # This is just another normal block. |
|
167 |
print |
|
|
167 | print('z is now:', z) | |
|
168 | 168 | |
|
169 |
print |
|
|
169 | print('bye!') | |
|
170 | 170 | ################### END EXAMPLE DEMO <ex_demo.py> ############################ |
|
171 | 171 | """ |
|
172 | 172 |
General Comments 0
You need to be logged in to leave comments.
Login now