Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Create this file:
- #jupyter notebook --generate-config
- c.NotebookApp.base_url = '/develop'
- c.NotebookApp.ip = '*'
- c.NotebookApp.open_browser = False
- c.NotebookApp.port = 9999
- #Generate password:
- #In [1]: from notebook.auth import passwd
- #In [2]: passwd()
- c.NotebookApp.password = 'sha1:XXXXX'
- import os
- from subprocess import check_call
- def post_save(model, os_path, contents_manager):
- """post-save hook for converting notebooks to .py scripts"""
- if model['type'] != 'notebook':
- return # only do this for notebooks
- d, fname = os.path.split(os_path)
- check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d)
- #check_call(['jupyter', 'nbconvert', '--to', 'html', fname], cwd=d)
- c.FileContentsManager.post_save_hook = post_save
Add Comment
Please, Sign In to add comment