Save an IPython notebook programmatically from within itself?

I am taking @Taar’s comment and making it an actual answer since it worked for the original person who asked the question and for myself. from IPython.display import display, Javascript display(Javascript(‘IPython.notebook.save_checkpoint();’)) This will create checkpoints – same thing as CTRL-s. Note: in Jupyter, CTRL-s triggers an async process and the file save is actually completed … Read more

programmatically add cells to an ipython notebook for report generation

There’s a Notebook gist by Fernando Perez here that demonstrates how to programmatically create new cells. Note that you can also pass metadata in, so if you’re generating a report and want to turn the notebook into a slideshow, you can easily indicate whether the cell should be a slide, sub-slide, fragment, etc. You can … Read more

Is there any way to generate a diff between two versions of an IPython notebook?

Notebook diff can be generated with nbdime. After installing nbdime you can run following to see notebook diff in browser: > nbdiff-web notebook_1.ipynb notebook_2.ipynb If you are using Github for version control you can use ReviewNB for Notebook diff. It lets you login via Github and browse commits/pull-request diff on your repo. You’ll see visual … Read more

Best way to run Julia code in an IPython notebook (or Python code in an IJulia notebook)

Run Julia inside an IPython notebook Hack In order to run Julia snippets (or other language) inside an IPython notebook, I just append the string ‘julia’ to the default list in the _script_magics_default method from the ScriptMagics class in: /usr/lib/python3.4/site-packages/IPython/core/magics/script.py or /usr/lib/python2.7/site-packages/IPython/core/magics/script.py. Example: # like this: defaults = [ ‘sh’, ‘bash’, ‘perl’, ‘ruby’, ‘python’, ‘python2’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)