Really confused with Jupyter Notebook, Lab, extensions, and ipywidgets

In general, stackoverflow question should try to only ask one question at the time. That being said, I’ll try to answer the questions as best I can: ipywidgets is the main way, yes. It is what people mean when they talk about notebook widgets. There is an issue tracking general JS in jupyterlab on the … Read more

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

read-only cells in ipython/jupyter notebook

@Richard Ackon’s answer requires adjustments for JupyterLab: Open the Property Inspector. Focus the cell you want to lock. Add the following lines to the Cell Metadata: { “trusted”: true, “editable”: false, “deletable”: false } Click on the tick to save the metadata… Tadah!, your cell can’t be modified or deleted. The Property Inspector comes built-in … Read more

using sudo inside jupyter notebook’s cell

Update: I checked all the methods, all of them are working. 1: Request password using getpass module which essentially hides input by user and then run sudo command in python. import getpass import os password = getpass.getpass() command = “sudo -S apt-get update” #can be any command but don’t forget -S as it enables input … 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

LaTeX error related to tcolorbox.sty not found

After installing tcolorbox using LaTex’s package manager tlmgr, I was getting similar errors for other dependencies. The solution below worked for me on Ubuntu 18.04 (64 bit) at the terminal: tlmgr update –all –self tlmgr install tcolorbox tlmgr install pgf tlmgr install xcolor tlmgr install environ tlmgr install trimspaces tlmgr install mathpazo tlmgr install parskip … Read more

tech