##// END OF EJS Templates
inputhook: improve stdin_ready()...
inputhook: improve stdin_ready() - move select and msvcrt imports in the function itself as they're only needed there - switch on os.name for platform dependent code - for unknow platforms, assume there's something to read

File last commit:

r4406:0251893c
r4914:a7617935
Show More
nbexamples.py
29 lines | 435 B | text/x-python | PythonLexer
from ..nbbase import (
NotebookNode,
new_code_cell, new_text_cell, new_notebook
)
nb0 = new_notebook()
nb0.cells.append(new_text_cell(
text='Some NumPy Examples'
))
nb0.cells.append(new_code_cell(
code='import numpy',
prompt_number=1
))
nb0.cells.append(new_code_cell(
code='a = numpy.random.rand(100)',
prompt_number=2
))
nb0.cells.append(new_code_cell(
code='print a',
prompt_number=3
))