diff options
Diffstat (limited to 'mac/.local/bin/vipy')
| -rwxr-xr-x | mac/.local/bin/vipy | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mac/.local/bin/vipy b/mac/.local/bin/vipy new file mode 100755 index 0000000..8e0e3cb --- /dev/null +++ b/mac/.local/bin/vipy @@ -0,0 +1,42 @@ +#!/bin/sh + +# Create a new notebook JSON structure +notebook='{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython" + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}' + +[ -z "$1" ] && echo "Enter a file name!" && exit + +# Write the JSON to a new .ipynb file +echo "$notebook" >"$1.ipynb" + +# Check if the file was created successfully +[ -f "$1.ipynb" ] && echo "$1.ipynb created successfully." || echo "Failed to create a Jupyter Notebook." |
