Skip to content

Instantly share code, notes, and snippets.

@tamuhey
Created April 3, 2019 01:43
Show Gist options
  • Select an option

  • Save tamuhey/7ab42a39465691139d032e994676cb57 to your computer and use it in GitHub Desktop.

Select an option

Save tamuhey/7ab42a39465691139d032e994676cb57 to your computer and use it in GitHub Desktop.
bash function for executing Jupyter notebook
# jupyter execution
function je(){
if [ $# = 2 ]
then
kernel=$2
elif [ $# = 1 ] && [ -n $CONDA_DEFAULT_ENV ]
then
kernel=$CONDA_DEFAULT_ENV
fi
echo $1 $kernel
jupyter nbconvert --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=$kernel --to notebook --execute $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment