Skip to content

Instantly share code, notes, and snippets.

@fomightez
Last active November 11, 2023 16:56
Show Gist options
  • Save fomightez/e4c46fb0edf541c4719fa6065b1031c7 to your computer and use it in GitHub Desktop.
Save fomightez/e4c46fb0edf541c4719fa6065b1031c7 to your computer and use it in GitHub Desktop.
est raises-exception tag Jupyter Notebook ipynb file CELL #2 HAS THE TAG ALREADY
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "1f680123-200c-46dd-80c2-958264f9d673",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"4"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"2 + 2 "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c77860d1-4a29-4500-9af2-3adeb21419e7",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"raises-exception"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
".\n",
".\n",
".\n"
]
},
{
"ename": "ZeroDivisionError",
"evalue": "division by zero",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 11\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m x \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m3\u001b[39m):\n\u001b[1;32m 10\u001b[0m executeSomething()\n\u001b[0;32m---> 11\u001b[0m \u001b[38;5;241;43m1\u001b[39;49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[38;5;241;43m0\u001b[39;49m\n",
"\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"
]
}
],
"source": [
"3 + 3\n",
"import time\n",
"\n",
"def executeSomething():\n",
" #code here\n",
" print ('.')\n",
" time.sleep(3) #60 seconds times 8 minutes\n",
"\n",
"for x in range(3):\n",
" executeSomething()\n",
"1/0"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "2272642b-5882-4a99-8a05-339b8708749c",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
".\n",
".\n",
".\n"
]
}
],
"source": [
"3 + 3\n",
"import time\n",
"\n",
"def executeSomething():\n",
" #code here\n",
" print ('.')\n",
" time.sleep(3) #60 seconds times 8 minutes\n",
"\n",
"for x in range(3):\n",
" executeSomething()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "4f7b141a-50c9-49bd-a175-a1f80cbd3271",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
".\n",
".\n",
".\n"
]
}
],
"source": [
"3 + 3\n",
"import time\n",
"\n",
"def executeSomething():\n",
" #code here\n",
" print ('.')\n",
" time.sleep(3) #60 seconds times 8 minutes\n",
"\n",
"for x in range(3):\n",
" executeSomething()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment