From 9cf5a5f41eb6b1600e627874a1f540a7a6956986 Mon Sep 17 00:00:00 2001 From: RainerWieland Date: Tue, 22 Apr 2025 12:39:45 +0200 Subject: [PATCH] Dateien nach "ipynb" hochladen --- ipynb/unpack (3).ipynb | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 ipynb/unpack (3).ipynb diff --git a/ipynb/unpack (3).ipynb b/ipynb/unpack (3).ipynb new file mode 100644 index 0000000..bb2200c --- /dev/null +++ b/ipynb/unpack (3).ipynb @@ -0,0 +1,64 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "b50d1c76-5cbf-48f4-b97f-0dc1905b32ed", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Die Zip-Datei \"sentipy.zip\" wurde erfolgreich entpackt.\n" + ] + } + ], + "source": [ + "import shutil\n", + "import os\n", + "import zipfile\n", + "\n", + "def unpack(zipfilename):\n", + " # Überprüfen, ob die Zip-Datei existiert\n", + " if os.path.isfile(zipfilename):\n", + " # Zip-Datei entpacken\n", + " with zipfile.ZipFile(zipfilename, 'r') as zip_ref:\n", + " zip_ref.extractall(zipfilename[0:-4])\n", + " print(f'Die Zip-Datei \"{zipfilename}\" wurde erfolgreich entpackt.')\n", + " else:\n", + " print(f'Die Zip-Datei \"{zipfilename}\" existiert nicht.')\n", + "unpack(\"sentipy.zip\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "88e68b09-0d52-4da6-9ee6-eed39a725587", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}