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