##// END OF EJS Templates
Merge pull request #1608 from minrk/ar_sugar_2.6...
Merge pull request #1608 from minrk/ar_sugar_2.6 don't rely on timedelta.total_seconds in AsyncResult (timedelta is new in python 2.7). This maintains compatibility with Python 2.6; the utility function introduced can be removed if/when we drop 2.6 support.

File last commit:

r1248:19e3b286
r6505:5750e2dd merge
Show More
nbexample_output.py
20 lines | 642 B | text/x-python | PythonLexer
/ docs / attic / nbexample_output.py
from notebook.markup import rest
rest.title('This is a Python Notebook')
rest.text("""\
Some plain text, without any special formatting.
Below, we define a simple function to add two numbers.""")
def add(x,y):
return x+y
rest.text("Let's use it with x=2,y=3:")
# This simply means that all code until the next markup call is to be executed
# as a single call. The editing screen should mark the whole group of lines
# with a single In[NN] tag (like IPython does, but with multi-line capabilities)
rest.input()
add(2,3)
# This output would appear on-screen (in the editing window) simply marked
# with an Out[NN] tag
rest.output("5")